Discuss Scratch

De_Eagle
Scratcher
51 posts

How do I make a sprite jump?

O.K, so I tried many different things and nothing sees to work. Does anyone know how to make a sprite jump (not fly)? Please help me!
1234abcdcba4321
Scratcher
1000+ posts

How do I make a sprite jump?

forever
if <touching color [color of ground]?> then
if <key [up arrow v] pressed?> then
repeat (10)
change y by (3)
end
repeat (5)
change y by (1)
end
wait (0.05) secs
end
else
change y by (-3)

You can make it more advanced later.

Last edited by 1234abcdcba4321 (Feb. 1, 2014 20:01:21)

VyzymZ
Scratcher
29 posts

How do I make a sprite jump?

You can make a variables called velocity & gravity, for better and cleaner movement.

when green flag clicked
set [velocity] to [0]
set [gravity] to [-0.3]
forever

if <touching [ground]?> then
if <key [space] pressed?> then
set [velocity] to (pick random (4) to (7))
set y position to ((y position) + (velocity))

end
else
set [velocity] to ((velocity) + (gravity))
set y position to ((y position) + (velocity))

end
end
But this script make the game more lag.

Last edited by VyzymZ (Feb. 1, 2014 22:44:51)

De_Eagle
Scratcher
51 posts

How do I make a sprite jump?

Thanks I tried it and it worked . I no longer have to just fly!
minecraftmaster23
Scratcher
6 posts

How do I make a sprite jump?

the red x position wher is it
minecraftmaster23
Scratcher
6 posts

How do I make a sprite jump?

[u
plz i need help on the y position block
minecraftmaster23
Scratcher
6 posts

How do I make a sprite jump?

VyzymZ wrote:

You can make a variables called velocity & gravity, for better and cleaner movement.

when green flag clicked
set [velocity] to [0]
set [gravity] to [-0.3]
forever

if <touching [ground]?> then
if <key [space] pressed?> then
set [velocity] to (pick random (4) to (7))
set y position to ((y position) + (velocity))

end
else
set [velocity] to ((velocity) + (gravity))
set y position to ((y position) + (velocity))

end
end
But this script make the game more lag.

thaks it works
picopaper
Scratcher
500+ posts

How do I make a sprite jump?

Here's my favorite jumping script:
when green flag clicked
forever

change [yv v] by (-0.5)
change y by (yv)
if <<touching [ground v]?> and <key [up arrow v] pressed?>> then
set [yv v] to [8]

end
if <touching [ground v]?> then
change y by ((yv) * (-1))
set [yv v] to [0]

end
end
This gives a good parabolic arc while still preventing “sink effect.” However, there is a slight bounce before you land.
Hope this helps!
1234abcdcba4321
Scratcher
1000+ posts

How do I make a sprite jump?

picopaper wrote:

Here's my favorite jumping script:
when green flag clicked
forever

change [yv v] by (-0.5)
change y by (yv)
if <<touching [ground v]?> and <key [up arrow v] pressed?>> then
set [yv v] to [8]
change y by (8)

end
if <touching [ground v]?> then
change y by ((yv) * (-1))
set [yv v] to [0]

end
end
This gives a good parabolic arc while still preventing “sink effect.” However, there is a slight bounce before you land.
Hope this helps!

That script doesn't work. I fixed it for you.
picopaper
Scratcher
500+ posts

How do I make a sprite jump?

1234abcdcba4321 wrote:

picopaper wrote:

Here's my favorite jumping script:
when green flag clicked
forever

change [yv v] by (-0.5)
change y by (yv)
if <<touching [ground v]?> and <key [up arrow v] pressed?>> then
set [yv v] to [8]
change y by (8)

end
if <touching [ground v]?> then
change y by ((yv) * (-1))
set [yv v] to [0]

end
end
This gives a good parabolic arc while still preventing “sink effect.” However, there is a slight bounce before you land.
Hope this helps!

That script doesn't work. I fixed it for you.
Sorry about that.
FluffyEmie4
Scratcher
3 posts

How do I make a sprite jump?

how do you get the red bocks?

Last edited by FluffyEmie4 (May 19, 2016 20:15:22)

GreenFlag2929
Scratcher
8 posts

How do I make a sprite jump?

Do you wanna get an apple drop? so what would you like?
play drum (hello v) for (0.25) beats
GreenFlag2929
Scratcher
8 posts

How do I make a sprite jump?

if you wanna start a script
when backdrop switches to <>
timer :: stack
GreenFlag2929
Scratcher
8 posts

How do I make a sprite jump?

(answer)(answer)(answer)
ask [] and wait
ask [] and wait
ask [] and wait
ask (answer)(answer)(answer)<key [(mouse x)(mouse y)<key [<touching color [#1b37da] ?>(distance to [ v]) v] pressed?> v] pressed?> and wait
set drag mode to [draggable v] :: sensing(distance to [<mouse down?>(mouse x)(timer) v])
set drag mode to [draggable v] :: sensing(loudness)(answer)
turn cw () degrees
change x by ()
turn cw () degrees
turn ccw () degrees
change x by ()
stop all sounds
play sound [ v] until done
play sound [ v]
GreenFlag2929
Scratcher
8 posts

How do I make a sprite jump?

set drag mode to [draggable v] :: sensing
set drag mode [draggable v] :: sensing
Scyth3d
Scratcher
500+ posts

How do I make a sprite jump?

Please don’t necropost
InvertedCookie67
Scratcher
1 post

How do I make a sprite jump?

I just use ai:

Last edited by InvertedCookie67 (Jan. 8, 2026 13:18:43)

Powered by DjangoBB