Discuss Scratch

lilakeety
Scratcher
4 posts

is there gravity and how to make it?

how?
ILoveShapes00
New Scratcher
1 post

is there gravity and how to make it?

watch warfame's video in youtube
you will get it!
mcgoomba
Scratcher
1000+ posts

is there gravity and how to make it?

when green flag clicked
forever
change [Y-velocity v] by (-1)
change y by (Y-velocity)
handle ground
end
define handle ground [RUN WITHOUT SCREEN REFRESH]
repeat until <not <touching color [ANY COLOR]>>
set [Y-velocity v] to [0]
change y by (1)
end
helloworldbyeworld
Scratcher
1000+ posts

is there gravity and how to make it?

mcgoomba wrote:

when green flag clicked
forever
change [Y-velocity v] by (-1)
change y by (Y-velocity)
handle ground
end
define handle ground [RUN WITHOUT SCREEN REFRESH]
repeat until <not <touching color [ANY COLOR]>>
set [Y-velocity v] to [0]
change y by (1)
end
So that repeat until block will run until it’s touching no colors? That’s not possible so it will keep going and the player will stick to the top of the screen. Instead of any color (you can’t even code that), use not touching ground or whichever sprite that has the platforms.
greendayfan7
Scratcher
78 posts

is there gravity and how to make it?

I finally figured it out here's the script https://scratch.mit.edu/projects/651415754/ I made a project for you about gravity
lilakeety
Scratcher
4 posts

is there gravity and how to make it?

mcgoomba
Scratcher
1000+ posts

is there gravity and how to make it?

helloworldbyeworld wrote:

mcgoomba wrote:

when green flag clicked
forever
change [Y-velocity v] by (-1)
change y by (Y-velocity)
handle ground
end
define handle ground [RUN WITHOUT SCREEN REFRESH]
repeat until <not <touching color [#0f0]>>
set [Y-velocity v] to [0]
change y by (1)
end
So that repeat until block will run until it’s touching no colors? That’s not possible so it will keep going and the player will stick to the top of the screen. Instead of any color (you can’t even code that), use not touching ground or whichever sprite that has the platforms.
until the player dosn't touch the color you don't want it to touch

Powered by DjangoBB