This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-10-25 11:50:23

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Double Jumping

I am having real trouble with a game I am making. I have a power-up which you collect, which allows you to do a double jump, but you can only do one double jump. I just can't get it to work. If you are going to help me, then remember that you can only do one double jump each time you collect the power-up.

Any help would be appreciated.


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#2 2009-10-25 12:10:55

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Double Jumping

Make a variable called (double jump) no parentheses. Then when the sprite collects the power up, set it to one. Then you need a script for the double jumping that activates when the variable is equal to 1. After the jumping motion on the same script, add a set double jump to 0. That should work...

Hope it helps!


Hai.

Offline

 

#3 2009-10-25 12:34:15

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Double Jumping

fg123 wrote:

Make a variable called (double jump) no parentheses. Then when the sprite collects the power up, set it to one. Then you need a script for the double jumping that activates when the variable is equal to 1. After the jumping motion on the same script, add a set double jump to 0. That should work...

Hope it helps!

That is pretty much what I've been trying, except I just have a variable called 'jump', that works normally when the power-up is not collected, by changing to 1 when it is in the air, and back to 0 when it touches the ground. But when the power-up is collected, is does that, but if you press the up button while 'jump' is 1, it sets it to 2, and jumps again, but this doesn't work, I'll try your way.


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

Board footer