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

#1 2012-02-16 14:31:36

aic92
New Scratcher
Registered: 2012-02-16
Posts: 2

Stop object when touched?

Hi, I've been trying to create a game in which your character has to catch falling objects and then answer a question if the object is caught. Problem is the object that is falling from the sky will continue to glide to the designated position even if it touches the other sprite. I need the falling object to stop once the sprite on the ground comes into contact with it. Here is the bit of code that relates to this:


when green flag clicked
hide
go to x: (variables) y:(180)
show
glide (3) secs x: (variables) y: (-180)
if <touching sprite 1>
ask (question) and wait

Offline

 

#2 2012-02-16 16:14:48

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: Stop object when touched?

try this

when gf clicked
hide
go to X: <(variables)> Y: <180>
repeat until <touching Sprite 1>
Point in direction <180>
move <Insert number here> steps
end
ask<(question)> and wait 

Last edited by muppetds (2012-02-16 16:15:24)


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#3 2012-02-16 16:16:29

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Stop object when touched?

muppetds wrote:

try this

when gf clicked
hide
go to X: (variables) Y: (180)
repeat until <touching [Sprite 1 v]?>
Point in direction (180)
move (Insert number here) steps
end
ask (question) and wait 

I fixed it.

Offline

 

#4 2012-02-16 18:12:05

aic92
New Scratcher
Registered: 2012-02-16
Posts: 2

Re: Stop object when touched?

Thank you!

Offline

 

Board footer