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

#1 2007-06-30 07:08:35

Lindsay_7321
Scratcher
Registered: 2007-06-30
Posts: 25

OMG ANSWER THIS!

how do i stop gobo from falling throught the platform when he jumps on it!

PLEASE!

Offline

 

#2 2007-06-30 07:58:05

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: OMG ANSWER THIS!

You need to set your gravity script to detect the platform, and only decrease Y when it isn't being touched.

Either have the platform as a sprite, and use "if touching (sprite)", or have the platform a specific colour and use "if touching colour".

Here is an example of the latter.

http://scratch.mit.edu/projects/Mayhem/15862


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2007-06-30 12:47:06

Lindsay_7321
Scratcher
Registered: 2007-06-30
Posts: 25

Re: OMG ANSWER THIS!

what do i put after this to stop it falling through!
and how to i set the gravity to detect platform!?

"if touching (sprite2)2

what goes next?

Offline

 

#4 2007-06-30 14:13:19

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: OMG ANSWER THIS!

It depends on how you have written "gravity" for your sprite.

In effect, though, you need to put a condition on your gravity script so that it only moves your sprite downwards if it isn't touching a platform.

Forever
- If NOT touching (platform)
- change y by -5
wait 0.05

Try something like that, and if you get it workign we can look at teh more advanced idea of it only stopping you falling when you are standing on top of it...


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#5 2007-07-01 08:39:50

Lindsay_7321
Scratcher
Registered: 2007-06-30
Posts: 25

Re: OMG ANSWER THIS!

how do i get the if NOT touching platform?

it isn't there

:S

Offline

 

#6 2007-07-01 08:55:37

Duncan
Scratcher
Registered: 2007-05-15
Posts: 47

Re: OMG ANSWER THIS!

Grab a yellow IF block from the Control instructions

Grab a Not from the green Numbers

Grab a Touching from the blue Sensing controls

Drop the Touching into the Not, drop both into the If then select the name of your platform sprite from the drop down menu on the Touching section.

Offline

 

#7 2007-07-01 11:14:32

Lindsay_7321
Scratcher
Registered: 2007-06-30
Posts: 25

Re: OMG ANSWER THIS!

ah i see! thanks v.much!

smile

Offline

 

Board footer