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

#1 2010-01-04 12:54:15

vitp4145
Scratcher
Registered: 2010-01-04
Posts: 3

Two sprites on one screen at the same time

I have two sprites on my screen. However, their scripts are on different script screens. Can I have command blocks for both sprites together? So that they can alternate speech bubbles to make it look like a conversation?

Offline

 

#2 2010-01-04 13:03:45

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Two sprites on one screen at the same time

If you can get the timing right, that should work fine.


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#3 2010-01-04 13:05:51

vitp4145
Scratcher
Registered: 2010-01-04
Posts: 3

Re: Two sprites on one screen at the same time

hmnwilson wrote:

If you can get the timing right, that should work fine.

So there is no way to have commands for the two sprites in one script screen?

Offline

 

#4 2010-01-04 13:12:55

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Two sprites on one screen at the same time

There's a way of doing this - if you use broadcasts. Like so:

SPRITE 1
<when green flag clicked>     <-- Start the thing you want to happen first with this
<say[ hello ]for( 2 )secs>        <-- Make Sprite2 do or say something
<broadcast[ hello]]                <-- Add a broadcast. You can name broadcasts anything

SPRITE 2
<when I receive[ hello]]         <-- Start the thing you want to happen after "hello" with this
<say[ hi! ]for( 1 )secs>           <-- Make Sprite 2  do/say something else
<broadcast[ hi! ]]                 <-- You can add more broadcasts if you want

SPRITE 1
<when I receive[ hi! ]]          <-- Make sure you use the right broadcast!
<say[ I've got to go! ] for ( 3 )secs>
<hide>

You could make it much longer than this, and you can add different things such as moving and changing costume. Or you can use the ask block (from Sensing) to make your conversation interactive. Hope this helps  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#5 2010-01-04 14:08:52

vitp4145
Scratcher
Registered: 2010-01-04
Posts: 3

Re: Two sprites on one screen at the same time

Wolfie1996 wrote:

There's a way of doing this - if you use broadcasts. Like so:

SPRITE 1
<when green flag clicked>     <-- Start the thing you want to happen first with this
<say[ hello ]for( 2 )secs>        <-- Make Sprite2 do or say something
<broadcast[ hello]]                <-- Add a broadcast. You can name broadcasts anything

SPRITE 2
<when I receive[ hello]]         <-- Start the thing you want to happen after "hello" with this
<say[ hi! ]for( 1 )secs>           <-- Make Sprite 2  do/say something else
<broadcast[ hi! ]]                 <-- You can add more broadcasts if you want

SPRITE 1
<when I receive[ hi! ]]          <-- Make sure you use the right broadcast!
<say[ I've got to go! ] for ( 3 )secs>
<hide>

You could make it much longer than this, and you can add different things such as moving and changing costume. Or you can use the ask block (from Sensing) to make your conversation interactive. Hope this helps  smile

This works just great! Thank you very much indeed. Great stuff!

Offline

 

#6 2010-01-04 15:31:02

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: Two sprites on one screen at the same time

You're welcome  big_smile  Glad to help!


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

Board footer