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
27 posts

Help With Jumping

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

end
repeat (10)
change y by (-2)
end

The over complicator, All of my code is over complicated. I know the easy way but where's the fun in that.
CBLetson
Just for fun

when I receive [ Wake up]
repeat until <(nap)=[1]>
add (code) to (projects)
insert (unnecessary code)
wait until <not<(brain)=(fried)>>
if <(time)=[2 a.m]> then
set(nap) to [1]
end
end
wait((2)*((60)*(60))) secs
set(nap) to [0]
broadcast[Wake up]
cbletson
Scratcher
27 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

The over complicator, All of my code is over complicated. I know the easy way but where's the fun in that.
CBLetson
Just for fun

when I receive [ Wake up]
repeat until <(nap)=[1]>
add (code) to (projects)
insert (unnecessary code)
wait until <not<(brain)=(fried)>>
if <(time)=[2 a.m]> then
set(nap) to [1]
end
end
wait((2)*((60)*(60))) secs
set(nap) to [0]
broadcast[Wake up]
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
100+ 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
100+ 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