Discuss Scratch

LUIGIPRO10
Scratcher
5 posts

How do you make your sprite jump and not keep going up.

In my script, when my sprite jumps it keeps on moving. Does anyone have any tips on how to make it jump only 5 y coordinates and then fall to the ground? In my program, it just keeps moving up if you hold the up button.
Mole_Gaming
Scratcher
100+ posts

How do you make your sprite jump and not keep going up.

you could set a variable to 1 whenever it touches the ground, and set it to 0 when you're in the air, the just have it be
ifkeyspacepressed?andvar=0thenjump scriptsend
crisostimo
Scratcher
500+ posts

How do you make your sprite jump and not keep going up.

There are many ways to do this

whenspacekeypressedifIsJumping=Truestopthis scriptsetIs JumpingtoTruesetVertical Momentumto5repeatuntilVerticalMomentum1)changeybyVerticalMomentumchangeVertical Momentumby-1ComedownagainsetIs JumpingtoFalse

Now this is only half the jump. I've left the rest to you, but you should be able to get the idea.

Powered by DjangoBB