Freeze Sprite speed

0 favourites
  • 9 posts
From the Asset Store
Have you ever dreamed of playing in a Speedball game or tournament?
  • Hello!

    I am wondering if it is possible to freeze a platform speed so that under certain conditions, the platform speed would no longer increase by the acceleration.

    Basically I want to figure out a way that I could have the platform speed freeze when jump is pressed. right now I have a running control that picks up speed by platform acceleration. Problem is, that it keeps increasing speed even in the air. I want the speed to be locked on jump. Hope that makes sense. Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Are you using the Platformer behaviour?

    Set your acceleration event to have the condition of "Is on floor".

    If not you could pull the same trick by having a boolean variable that set to True when your player is overlapping with the floor sprite.

  • Mr E Bear, thanks for your input, but tried both, and the speed still picks up even after in the air. I need it to freeze the speed, as soon as the sprite leaves the floor somehow.... Hmmmmm....

  • Something like this?

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/jumpingStopAcceleration.png" border="0">

    jumpingStopAcceleration.capx (r99)

  • Hahah, yup that did it. So simple. I feel kind of silly. Thought it was going to be a lot more complicated. Thanks!

  • Oh wait. Actually that is not quite what I am looking for, as that makes it so you can not control your player at all in the air... Hmmmm...

  • This might be more what you want:

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/jumpingStopAcceleration2.png" border="0">

    jumpingStopAcceleration2.capx (r99)

  • Hey, that works. But it makes it so if you are not moving before you jump, you can not shift in the air at all, which I understand is part of it, but I am wondering how I could add a little movement when the x vector is zero. Hmmmm, thank you so much, for your help.

  • So you want a minimum maximum (<img src="smileys/smiley26.gif" border="0" align="middle" />) speed?

    player is jumping:

          set platform maximum speed to max(100, abs(player.Platform.VectorX))

    so the maximum speed will be at least 100 or whatever when jumping.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)