Discuss Scratch

-suly-
Scratcher
3 posts

Creating Gravity and ground collison

To Create Gravity you have to…
when green flag clicked
forever
change [Velocity] by (-0.5)
if <touching [ground]> then
change y by (3)
set [Velocity] to [0]
end
end
and with it you need something to move it.
when green flag clicked
forever
if <key [w] pressed?> then
change [Velocity] by (17.5)
wait until <not <key [w] pressed?>>
end
end
Then to apply the velocity
when green flag clicked
forever
change y by (Velocity)
end

Last edited by -suly- (Feb. 3, 2025 07:49:10)

Paddle2See
Scratch Team
1000+ posts

Creating Gravity and ground collison

Hello! It's great that you want to help out other Scratchers. However, I think we have enough guides in the forums at the moment. Please feel free to welcome new Scratchers on the group welcoming topic or on individual topics created by New Scratchers.

Other places that can always use more helpful Scratchers like you, are the "Help With Scripts“ and ”Questions About Scratch" areas - please use them as designed, by responding to topics created by folks with problems to solve

Finally, a really good place for Scratch guides is the Scratch Wiki - check it out and see if it's something you might like to work on. They have a number of guides - and great organization.

Powered by DjangoBB