How do I Prevent "Falling" Unless after a Jump?

Get help using Construct 2

Post » Tue Sep 30, 2014 12:03 pm

As the platform tutorial says you shouldn't have the behavior on an animated object, make sure you are using a non-animated box with the platform movement otherwise animations will intefere with the collision detection of the platform behavior.

If you don't want small falls to block jumps, just allow a jump as long as you've been touching the ground within the past, say, 50ms. You will probably have to set the vector Y manually since the behavior won't let you jump if you're in mid-air.

I don't know why you're asking about forcing a platform animation since the behavior doesn't actually set animations, it just fires triggers as guides which you can ignore if you like and replace with other events if it suits you better.
Scirra Founder
B
415
S
248
G
92
Posts: 25,295
Reputation: 200,974

Post » Tue Sep 30, 2014 2:58 pm

@Ashley

My bad i guess i dont mean the animations themselves, but the platform state which triggers the animation. Definitely using a green square as my player controller. Sorry for the weird way to ask about it. I think the millisecond delay might work since its always just little 'ticks' that block the jump.. trying to wrap my head around the actions, but i think i'll get there. Thanks for your help!

Nate
Made Cosmochoria - www.cosmochoria.com
Made Slayaway Camp - www.slayawaycamp.com
Made Friday the 13th: Killer Puzzle - www.f13killerpuzzle.com
B
29
S
9
G
4
Posts: 387
Reputation: 5,676

Post » Tue Sep 30, 2014 3:47 pm

This did the trick Ashley, thank you. I removed the 'requirement' for the player to be 'on-floor' when triggering a jump. Instead I created a "jumpAble" instance variable, which is set to 1 when touching ground. If you leave the ground it subtracts at 0.04 per tick (found it to be the best balance) So basically in less than a second its set to zero. Then i just said:

- If you push jump
- and jumpAble > 0
- Set jumpAble = 0
- Move player at velocity -X (jump height)

Thanks again. Game getting smoother and smoother :)
Made Cosmochoria - www.cosmochoria.com
Made Slayaway Camp - www.slayawaycamp.com
Made Friday the 13th: Killer Puzzle - www.f13killerpuzzle.com
B
29
S
9
G
4
Posts: 387
Reputation: 5,676

Post » Wed Oct 01, 2014 12:46 am

Awesome! Glad to see this solved. Great solution!
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests