Discuss Scratch

0611AlexanderKo
Scratcher
3 posts

Need You Help To script A gravity Script?

when green flag clicked //First You need Create This Variables Below
hide variable [is Gravity on? v]
hide variable [Gravity v]
hide variable [Gravity_size v]
set [is Gravity on? v] to [1]
set [Gravity v] to [0.1]
set [Gravity_size v] to (join [-] [3])
forever
if <<[is Gravity on?] = [1]>> then
change y by (Gravity_size)
if <touching [Ground v] ?> then //You need Created A Sprite With The name: Ground
wait until <not <touching [Ground v] ?>>
wait (Gravity) secs
end
end
else
end
end

Powered by DjangoBB