scratch lesson 9 from stories to animations part ii

15
SC Lesson 9: In Part II, I will show you ho broadcast message and “wai 1: A Stage is Like a Sprite A Stage is like a Sprite. A Sta think (such as doing math) a on Stage), just like a Sprite. “messages”, which will be co The main difference between than that, a Stage is just like illustration should make this A Sprite changes costumes. A Stage changes background Cha Shall W CRATCH PROGRAMMING : From Stories to Animations Part ow to add scene transition to your anim it” control blocks. e age can change its look, just as a Spri and feel (such as checking if a sprite is Both Stages and Sprites can send and overed in this lesson. n a Stage and a Sprite is that a Stage c e a Sprite. I am already repeating mys painfully clear. ds. Change Background ange Costume We Learn | shallwelearn.com 1 t II mation using ite. A Stage can also s touching another d receive cannot move. Other self but the following

Upload: jessica-chiang

Post on 17-Nov-2014

5.639 views

Category:

Documents


0 download

DESCRIPTION

Lesson 9 of Shall We Learn Scratch Programming

TRANSCRIPT

Page 1: Scratch Lesson 9 From Stories to Animations Part II

SCRATCH PROGRAMMING

Lesson 9:

In Part II, I will show you how to add scene transition to

broadcast message and “wait

1: A Stage is Like a Sprite

A Stage is like a Sprite. A Stage

think (such as doing math) and feel (such as checking if a sprite is touching another on Stage), just like a Sprite.

“messages”, which will be covered in this lesson.

The main difference between a Stage and a S

than that, a Stage is just like a Sprite. illustration should make this

A Sprite changes costumes.

A Stage changes backgrounds

Change

Shall We Learn

SCRATCH PROGRAMMING

: From Stories to Animations Part I

, I will show you how to add scene transition to your animation using

wait” control blocks.

a Sprite

A Stage can change its look, just as a Sprite

h) and feel (such as checking if a sprite is touching another Both Stages and Sprites can send and receive

will be covered in this lesson.

nce between a Stage and a Sprite is that a Stage can

, a Stage is just like a Sprite. I am already repeating myself but the following should make this painfully clear.

backgrounds.

Change Background

hange Costume

Shall We Learn | shallwelearn.com

1

Part II

your animation using

Sprite. A Stage can also

h) and feel (such as checking if a sprite is touching another and receive

prite is that a Stage cannot move. Other

I am already repeating myself but the following

Page 2: Scratch Lesson 9 From Stories to Animations Part II

Both a Sprite and a Stage can think and feel.

Moreover, both Stages and Sprites can send

Does green

make me

look bigger?

Shall We Learn

Both a Sprite and a Stage can think and feel.

Stages and Sprites can send and receive “messages

reen

make me

bigger?

Mmmm,

candies

Shall We Learn | shallwelearn.com

2

messages”.

Page 3: Scratch Lesson 9 From Stories to Animations Part II

2: Scene Transition and Broadcast Messages

First, we need to design the story board.

Scene 1 (the village background): Bobby stood in front of a remote

village

Scene 3 (training ground): Master Meow trained Bobby.

Next, we will use Broadcast Messages to move.

Shall We Learn

and Broadcast Messages

design the story board.

Bobby stood in front of a remote Scene 2 (school): Bobby was in class, being teased at.

ground): Master Meow trained Bobby. Scene 4 (fighting stage): Bobby fought with the Bully and won!

Next, we will use Broadcast Messages to let actors (sprites) know when and where to

Shall We Learn | shallwelearn.com

3

lass, being teased at.

(fighting stage): Bobby fought with the Bully and won!

ow when and where to

Page 4: Scratch Lesson 9 From Stories to Animations Part II

Introducing Broadcast Messages

Each scene has a set of sprites and each sprite needs to know where to go

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

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 t

“school” as message name. Click “OK” to save this new Broadcast Message.

Shall We Learn

Introducing Broadcast Messages

Each scene has a set of sprites and each sprite needs to know where to go

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.

is a message sent by a Sprite or a Stage, and can be received by send out Broadcast Messages. Click Control button from

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.

Shall We Learn | shallwelearn.com

4

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.

is a message sent by a Sprite or a Stage, and can be received by Click Control button from

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.

he “new…” from the popped bubble and then enter

“school” as message name. Click “OK” to save this new Broadcast Message.

Page 5: Scratch Lesson 9 From Stories to Animations Part II

In total, we need these messages:Fighting Stage”, “Done Laughing”, and

Message 1: "To School"

Message 4: "To Fighting Stage"

Shall We Learn

In total, we need these messages: “To School”, “To Village”, “To Training Ground”, “Done Laughing”, and “Done Training”.

Message 2: To School Message 3: To Training Ground

Message 5: Done Laughing Message 6: Done Training

Shall We Learn | shallwelearn.com

5

“To Training Ground”, “To

: To Training Ground

: Done Training

Page 6: Scratch Lesson 9 From Stories to Animations Part II

VILLAGE SCENE

Stage would change to “Village” background and

message (to everyone). Upon Stage; all other sprites just hide

Shall We Learn

Stage would change to “Village” background and sends out a “To Villa

Upon receiving the “To Village” message, hide.

Shall We Learn | shallwelearn.com

6

a “To Village” broadcast

Bobby shows up on

Page 7: Scratch Lesson 9 From Stories to Animations Part II

Shall We Learn | shallwelearn.com

7

SCHOOL SCENE

Then the Stage would wait two seconds, change its background to “School”, and then broadcast a “To School” message. Upon receiving the “To School” message, Bobby,

bully, and sidekick all show up on Stage. They also would change to appropriate costumes: Bobby would change to “right” costume, bully to “up”, and sidekick to

“tease”. Moreover, the bully Sprite would say “Ha Ha” for two seconds. I know it’s not really serious bullying, but hey, verbal abuse is abuse nevertheless. Once finished

laughing, the bully would send out a “Done Laughing” message.

Page 8: Scratch Lesson 9 From Stories to Animations Part II

The result snapshot of the Stage

Upon receiving this “Done Laughing” message, Stage w

Ground” background and broadcast a “To Training Ground” message.

Shall We Learn

The result snapshot of the Stage of this scene looks like this:

Upon receiving this “Done Laughing” message, Stage would change to “Training

Ground” background and broadcast a “To Training Ground” message.

Shall We Learn | shallwelearn.com

8

ould change to “Training

Ground” background and broadcast a “To Training Ground” message.

Page 9: Scratch Lesson 9 From Stories to Animations Part II

TRAINING SCENE

At the training scene, Bobby would spinthen sends out a “Done Training” message.

The result snapshot of the Stage

Shall We Learn

At the training scene, Bobby would spin-kick across the field for several times and then sends out a “Done Training” message.

The result snapshot of the Stage of this scene looks like this:

Shall We Learn | shallwelearn.com

9

kick across the field for several times and

Page 10: Scratch Lesson 9 From Stories to Animations Part II

Shall We Learn | shallwelearn.com

10

Upon receiving this “Done Training” message, Stage would change to “Fighting Stage”

background and broadcast a “To Fighting Stage” message.

Page 11: Scratch Lesson 9 From Stories to Animations Part II

Shall We Learn | shallwelearn.com

11

FIGHTING SCENE

At the fighting scene, Bobby would kick (by repeatedly changing between “fly kick left” and “fly kick right” costumes) Bully’s until Bully is defeated. To animate the bully

being kicked, just repeatedly change the bully’s costumes between “up” and “down”. Once the bully has been kicked badly enough, he would say “OK OK You Win”.

Page 12: Scratch Lesson 9 From Stories to Animations Part II

This is the snapshot of the Stage at the Fighting Scene:

3: Put Together Scripts for Each Sprite

Below are snapshots of scripts for all sprites.

backgrounds.

Shall We Learn

This is the snapshot of the Stage at the Fighting Scene:

Put Together Scripts for Each Sprite

Below are snapshots of scripts for all sprites. The Stage’s scripts handle changing

Shall We Learn | shallwelearn.com

12

pts handle changing

Page 13: Scratch Lesson 9 From Stories to Animations Part II

Shall We Learn | shallwelearn.com

13

Master Meow’s scripts are very easy because he just shows and hides.

Sidekick’s scripts are also very easy because he just shows and hides.

Page 14: Scratch Lesson 9 From Stories to Animations Part II

Shall We Learn | shallwelearn.com

14

Bobby’s scripts involve showing, hiding, as well as fly-kicking

Page 15: Scratch Lesson 9 From Stories to Animations Part II

Shall We Learn | shallwelearn.com

15

Besides showing and hiding, the bully’s scripts involve laughing and being kicked down

by Bobby.

TEST TIME: Whew! We are done. Go ahead and test your first animation. This

concludes Lesson 9.