Discuss Scratch

Soron64
Scratcher
2 posts

Limited Jump

Hello,

I am making a platformer. I am trying to achieve limited jumps. Here is my code:

https://scratch.mit.edu/projects/643109540/

Thanks!
DepthOfDistruct
Scratcher
77 posts

Limited Jump

do something like

if <key [up arrow] pressed?> then
set [spdy] to [10]
end

make sure to put that in the Col.y inside of the repeat until not touching color gray

Last edited by DepthOfDistruct (Feb. 14, 2022 02:43:40)

Soron64
Scratcher
2 posts

Limited Jump

DepthOfDistruct wrote:

do something like

if <key [up arrow] pressed?> then
set [spdy] to [10]
end

make sure to put that in the Col.y inside of the repeat until not touching color gray

I am trying to make it so that the player can only jump one and not infinetly
NMario84
Scratcher
1000+ posts

Limited Jump

Make a variable to indicate that the jump button was pressed. Make sure the condition only works if this value was not set otherwise.

I did this as an experiment in one of my earlier example projects.
https://scratch.mit.edu/projects/552278714/

Powered by DjangoBB