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

#1 2008-11-12 04:17:33

ChainzzDB
Scratcher
Registered: 2008-08-11
Posts: 58

The # time

I have a question. If i wan't to make a script, like "If sprite1 turns into costume 2 the third time, change into costume 3". How should i do it?


http://scratch.mit.edu/users/ChainzzDB

Offline

 

#2 2008-11-12 05:24:23

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: The # time

Probably the easiest way would be with the Repeat loop and a Broadcast block.  Like this:

On Sprite 1, have this script

[blocks]
<when green flag clicked>
<repeat( 3
...blocks that do cool movement and stuff...
<switch to costume[ 2
<end>
<broadcast[ Change Sprite 2
[/blocks]

Then, on Sprite 2, have a script like this:

[blocks]
<when I receive[ Change Sprite 2
<switch to costume[ 3
[/blocks]

So this method has Sprite 1 telling Sprite 2 when to change.  There are ways to do it more like what you asked with Sprite 2 watching Sprite 1 and doing things based on what Sprite 1's actions are - but they require using variables and the sensing block which I think is a more complicated approach.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer