Discuss Scratch
- Discussion Forums
- » New Scratchers
- » How do I add gravity to my game (really good gravity)
- TGage23
-
2 posts
How do I add gravity to my game (really good gravity)
I want it to work with only one sprite
- Link2358
-
100+ posts
How do I add gravity to my game (really good gravity)
Most games just change a Y Velocity variable by -1 to create gravity*. But if you want realistic gravity you can find some documentation on the scratch wiki or you can copy the code I made**

Good luck on your project!
when green flag clicked
forever
change [Y Velocity v] by (-1)
change y by (Y Velocty)
end

Good luck on your project!

- TGage23
-
2 posts
How do I add gravity to my game (really good gravity)
i will use simple code thanks
if you do not mind can you help me come up with a game name : )

- iX-Xi
-
100+ posts
How do I add gravity to my game (really good gravity)
also don't forget the:
for actual floor detection
when green flag clicked
forever
if <touching [ground v] ?> then
set [Y Velocity v] to ((Y Velocity) * (-0.5))
wait (0) secs
end
end
for actual floor detection
- Discussion Forums
- » New Scratchers
-
» How do I add gravity to my game (really good gravity)