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

#1 2009-12-23 07:11:38

macman2706
Scratcher
Registered: 2009-12-23
Posts: 1

stopping sprites

My question:

If i want my sprite to stop, for example,

If touching colour X, stop moving (in that direction)

then how do i program it?

Offline

 

#2 2009-12-23 07:45:32

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: stopping sprites

Try this, if the sprites touching the colour X it will stop moving
[blocks]
<forever>
<if><<  <not> <touching color[ X ] >>
<move( X )steps>
<end>
<end>
[/blocks]
The sprite will start moving again if it stops touching the colour or you could try this
[blocks]
<repeat until><touching color[ X ]
<move( X )steps>
<end>
[/blocks]
Which will stop the sprite from moving forever after it touches the colour X

Last edited by what-the (2009-12-23 07:49:07)


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

Board footer