Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how can i make gravity
- Andretooo
-
Scratcher
6 posts
how can i make gravity
The basic concept where v is the velocity and the value set to -2 is the acceleration:

Implementing some simple jumping mechanics:


Implementing some simple jumping mechanics:

- T1G3Rhead
-
Scratcher
42 posts
how can i make gravity
when green flag clicked
forever
repeat until <touching [stage] ?>
change [gravity] by (-0.4)
change y by (gravity)
end
end
- T1G3Rhead
-
Scratcher
42 posts
how can i make gravity
hope this helps, T1G3Rheadwhen green flag clicked
forever
repeat until <touching [stage] ?>
change [gravity] by (-0.4)
change y by (gravity)
end
end
p.s. get a profile pic, please
- s181070tkomps
-
Scratcher
1 post
how can i make gravity
when green flag clicked
forever
if < <touching [ air] ?> > then
set [ Y] by (-2)
when green flag clicked
forever
if < <key [ up arrow key] pressed?> > then
change y by (10)
wait (0.1) secs
change y by (Y)
if < <touching [ ground ] ?> > then
set [ Y] to [0]
end
This may make gravity, if you want it to fall faster change’Y’ -3,4,5,6,7,8,9,10……
Last edited by s181070tkomps (April 4, 2022 01:18:35)
- derek20idk
-
Scratcher
1 post
how can i make gravity
when green flag clicked
forever
if <not <touching [Stage] ?>> then
change [gravity] by (-0.2)
else
set [gravity] to (0)
end
end
when green flag clickedhope this helps, have a good time scratching
forever
change y by (gravity)

(or something idk-)
- 106809nes
-
Scratcher
1000+ posts
how can i make gravity
Is this a necropost? Also this was made in 2022~when green flag clicked
forever
if <not <touching [Stage] ?>> then
change [gravity] by (-0.2)
else
set [gravity] to (0)
end
endwhen green flag clickedhope this helps, have a good time scratching
forever
change y by (gravity)
(or something idk-)
- Sunky-mpegx
-
Scratcher
8 posts
how can i make gravity
Since you've got your question answered can you please close this?

- NIKI-KOLCHAGOV
-
Scratcher
500+ posts
how can i make gravity
WellSince you've got your question answered can you please close this?Dude this was made in 2022, read #9
- Discussion Forums
- » Help with Scripts
-
» how can i make gravity