This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-04-14 14:02:38

09tdr
New Scratcher
Registered: 2011-04-14
Posts: 2

Falling from a platform

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  smile

Offline

 

#2 2011-04-14 14:28:33

GurkinC
Scratcher
Registered: 2009-11-30
Posts: 100+

Re: Falling from a platform

What scripts are you using for movement?


Try my latest game, Rolling 2, a 10-level platform game based around the gravity marble.

Offline

 

#3 2011-04-14 15:20:46

09tdr
New Scratcher
Registered: 2011-04-14
Posts: 2

Re: Falling from a platform

<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

 

#4 2011-04-15 14:16:26

dudymate
Scratcher
Registered: 2011-01-07
Posts: 95

Re: Falling from a platform

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  smile

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

 

Board footer