Discuss Scratch

BSP_123
Scratcher
4 posts
HoodieCoder
Scratcher
15 posts

help in script

You have to make a custom block named “Gravity” and in it you do this:

define Gravity
forever
if <<not <key [ Up arrow] pressed?>>> then
repeat until <touching [ Level] ?>
change y by (-12)
end

Last edited by HoodieCoder (Yesterday 17:08:30)

BSP_123
Scratcher
4 posts

help in script

i meant the infinite jumping

Last edited by BSP_123 (Today 06:15:02)

mmhmBeans
Scratcher
500+ posts

help in script

For that, you can detect if the player is touching the ground before jumping:

if <<touching [level v]?> and <<key [space v] pressed?>or <<key [w v] pressed?> or <key [up arrow v] pressed?>>>> then
...
end

This wouldn't work with your current system for jumping though. You can see how it's done in griffpatch's tutorial: https://youtu.be/D16hTnDGweo?t=196

Last edited by mmhmBeans (Today 07:03:02)


Hello, fellow human! I am also a human. I like to do human things like breathing oxygen, eating food and sleeping. I have emotions that are very complex and unique.
BSP_123
Scratcher
4 posts

help in script

thank you fello hoomam

Powered by DjangoBB