Discuss Scratch

gtar1
Scratcher
100+ posts

Help With Jumping

So, I have the same script for the circle as in this project, https://scratch.mit.edu/projects/203019554/ , but I want to make the player jump when the space bar is pressed.

If they say the sky's the limit, then why are there footprints on the moon?

I hope this helps! If you need any further, clarification, just ask!
cbletson
Scratcher
15 posts

Help With Jumping

do
when [ space] key pressed
repeat (10)
change y by (2)

end
repeat (10)
change y by (-2)
end
cbletson
Scratcher
15 posts

Help With Jumping

cbletson wrote:

do
when [ space] key pressed
repeat (10)
change y by (2)

end
repeat (10)
change y by (-2)
end
you dont have to use 10 and 2 but make sure how ever many you go up u go down the same amount
gtar1
Scratcher
100+ posts

Help With Jumping

cbletson wrote:

do
when [ space] key pressed
repeat (10)
change y by (2)

end
repeat (10)
change y by (-2)
end
I would like it to be a bit smoother, like in a platformer

If they say the sky's the limit, then why are there footprints on the moon?

I hope this helps! If you need any further, clarification, just ask!
Mittensbrother
Scratcher
90 posts

Help With Jumping

More examples of jump scripts than you can shake a stick at here on the Wiki:

https://wiki.scratch.mit.edu/wiki/Jumping
ParadoxScratching
Scratcher
88 posts

Help With Jumping

This should help a lot

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

Did I help? If so, consider following me!

Powered by DjangoBB

Standard | Mobile