Freeze Sprite speed

Get help using Construct 2

Post » Thu Jul 12, 2012 6:46 pm

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!
B
3
Posts: 20
Reputation: 315

Post » Thu Jul 12, 2012 10:35 pm

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.
B
49
S
14
G
3
Posts: 540
Reputation: 5,611

Post » Fri Jul 13, 2012 5:07 am

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....
B
3
Posts: 20
Reputation: 315

Post » Fri Jul 13, 2012 3:15 pm

B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Sat Jul 14, 2012 4:52 pm

Hahah, yup that did it. So simple. I feel kind of silly. Thought it was going to be a lot more complicated. Thanks!
B
3
Posts: 20
Reputation: 315

Post » Sat Jul 14, 2012 5:06 pm

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...
B
3
Posts: 20
Reputation: 315

Post » Sun Jul 15, 2012 12:11 am

This might be more what you want:


jumpingStopAcceleration2.capx (r99)
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Tue Jul 17, 2012 5:22 am

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.
B
3
Posts: 20
Reputation: 315

Post » Tue Jul 17, 2012 5:14 pm

So you want a minimum maximum () 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.
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Governador, RookieDev, tarek2, Thelegendvinny and 18 guests