In Part II, I will show you how to add scene transition to your animation using broadcast message and â€œwaitâ€ control blocks.
A Stage is Like a Sprite
A Stage is like a Sprite. A Stage can change its look, just as a Sprite. A Stage can also think (such as doing math) and feel (such as checking if a sprite is touching another on Stage), just like a Sprite. Both Stages and Sprites can send and receive â€œmessagesâ€, which will be covered in this lesson.
The main difference between a Stage and a Sprite is that a Stage cannot move. Other than that, a Stage is just like a Sprite. I am already repeating myself but the following illustration should make this painfully clear.
A Sprite changes costumes.
A Stage changes backgrounds.
Both a Sprite and a Stage can think and feel.
Moreover, both Stages and Sprites can send and receive â€œmessagesâ€.
2: Scene Transition and Broadcast Messages
First, we need to design the story board.
Next, we will use Broadcast Messages to let actors (sprites) know when and where to move.
Introducing Broadcast Messages
Each scene has a set of sprites and each sprite needs to know where to go in a scene. Moreover, some sprites do not show up in some scenes. To let sprites know when and where they will go as scenes change, we will use Broadcast Messages.
A Broadcast Message is a message sent by a Sprite or a Stage, and can be received by all Sprites. We will let Stage send out Broadcast Messages. Click Control button from the Tool Kit.
Drag out a â€œbroadcastâ€ block from Control Took Kit and drop it in Stageâ€™s Script Editor. Click the little down arrow and select a message or create a new message.
To create a new message, click the â€œnew…â€ from the popped bubble and then enter â€œschoolâ€ as message name. Click â€œOKâ€ to save this new Broadcast Message.
In total, we need these messages: â€œTo Schoolâ€, â€œTo Villageâ€, â€œTo Training Groundâ€, â€œTo Fighting Stageâ€, â€œDone Laughingâ€, and â€œDone Trainingâ€.
Stage would change to â€œVillageâ€ background and sends out a â€œTo Villageâ€ broadcast message (to everyone). Upon receiving the â€œTo Villageâ€ message,
When Bobby shows up on Stage; all other sprites just hide.