Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I make a sprite jump?
- 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 clickedBut this script make the game more lag.
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
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?
[u
plz i need help on the y position block
plz i need help on the y position block
- minecraftmaster23
-
Scratcher
6 posts
How do I make a sprite jump?
You can make a variables called velocity & gravity, for better and cleaner movement.when green flag clickedBut this script make the game more lag.
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
thaks it works

- picopaper
-
Scratcher
500+ posts
How do I make a sprite jump?
Here's my favorite jumping script:
Hope this helps!
when green flag clickedThis gives a good parabolic arc while still preventing “sink effect.” However, there is a slight bounce before you land.
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
Hope this helps!

- 1234abcdcba4321
-
Scratcher
1000+ posts
How do I make a sprite jump?
Here's my favorite jumping script:when green flag clickedThis gives a good parabolic arc while still preventing “sink effect.” However, there is a slight bounce before you land.
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
Hope this helps!
That script doesn't work. I fixed it for you.
- picopaper
-
Scratcher
500+ posts
How do I make a sprite jump?
Sorry about that.Here's my favorite jumping script:when green flag clickedThis gives a good parabolic arc while still preventing “sink effect.” However, there is a slight bounce before you land.
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
Hope this helps!
That script doesn't work. I fixed it for you.
- 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?
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
- 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)
- Discussion Forums
- » Help with Scripts
-
» How do I make a sprite jump?

