Forums

limiting jumps to, say two


Subscribe to limiting jumps to, say two 4 posts, 4 voices

 

Jun 29, 2008 1:28am

Sammas_Mcknz Sammas_Mcknz 3 posts

how do you limit the amount of times you can jump?

I wish I could, but I can't be bothered

 

Jun 29, 2008 2:12am

Nidoking Nidoking 871 posts

Have a counter and check it when the player presses the jump button. If you haven't hit the maximum value, add one and jump. If you have, don't jump. Reset the counter to zero when they can jump again.

 

Jun 29, 2008 11:23am

Trollsplatterer Trollspla...
Moderator 2844 posts

You'll probably want to use variables. There's an explanation about these in the YoYo Games WIKI. Check it out when the server is back on.

Visit www.trollsplatterer.be for some files I made to help people out.

 

Jul 4, 2008 1:53pm

miner1666 miner1666 119 posts

add a variable in the startevent like:
maxjumptime = 10
then in the colision event with a wall add:
maxjumptime -= 1
ifn the keyboard event of the key u need to press to jump add:
if maxjumptime > 0
{
the code;
}


its just a file...
you'll get it back...
at least you hope so...