Hi, I'm new here, I was wondering if anyone could tell me how to use a gravity element, in the way that if your sprite steps off a platform it will fall to a lower platform/floor. I have the code to make it jump (and fall) until it reaches a higher platform, but it won't fall any lower than the height it is at. If that makes any sense, a little help would be greatly appreciated
Offline
<when[ Space ]key pressed>
<switch to costume[ 2 (jumping costume)
<set{ Jump }to( 10
<repeat( 21
<change y by( Jump
<if><color[ Red (sprites feet]is over[ Black (platform)
<switch to costume[ 1
<stop script>
<else>
<change{ Jump }by( -1
<wait( 0.01 )secs>
<end>
<end>
Offline
09tdr wrote:
Hi, I'm new here, I was wondering if anyone could tell me how to use a gravity element, in the way that if your sprite steps off a platform it will fall to a lower platform/floor. I have the code to make it jump (and fall) until it reaches a higher platform, but it won't fall any lower than the height it is at. If that makes any sense, a little help would be greatly appreciated
![]()
non ghosting through objects or ghosting through objects the is ghost through objects
now lets say the platforms are green
<when green flag clicked><forever><if><touching color[green<if><key[space]pressed?> <repeat(10 <change y by( 10 <if> <not><touching color[green <repeat until> <touching color[green <change y by(-10
Offline