clear clear - Smart Classroom

> Shy Bunny and friends in a trap! How can they escape?
Chapter 12
Yes What
is that?
Even if the
traps are interconnected, how do
we escape?
Maybe, you are
supposed to push
them at the same
time. PRESS
Escaping
Together!
Learning Objective :
Let's design a game where two players
can play in one computer and let's enjoy
the game together by connecting two
computers.
PRESS
Ta-da
Wow!
We have keys!
1P
1P
2P
PRESS
It does
not work?
We now have a
door! I guess we
can escape
2P
RRRR
EAAA
LEEA
LLLE
CCCC
120
| Chapter 12
> What significance does the key Shy Bunny discovered hold?
121
Discovering Principles
Shy Bunny who was looking around the trap carefully
discovered switch and pressed the switch with Scratch
Cat at the same time and got the keys. Just as Shy Bunny
and Scratch Cat cooperate, you should play a game with
your friend on a single PC. Let’s find out about sprite’s
movement in game and how the game rules actually
appear.
1. Let’s run(
3. Let’s see what kind of movements exist in <rock escaping game> that has been
played. Various elements including not only Scratch Cat but also hill, cloud
change and move according to the situation. Let me explain how each element
is moving.
<Scratch>
<Hill>
<Cloud>
<Banana>
<Rock>
Ex) It jumps when you press
space key. It becomes slower
when it jumps and becomes
faster when it falls.
) Chapter 12 seed project.
<Grass>
2. Let’s control Scratch according to operating method and game rules. Let’s score high by evading rocks with jumps and eating bananas.
Shall we find out how the hill or
the background is expressed?
The stage is composed of four.
Operating method
You can escape rocks by pressing
space key and jumping.
Game rule
Banana or rocks comes down from the
When you take a look at it from
the top, grass that was depicted
jump
small becomes larger and it
is placed on the lower side.
banana!
Likewise, moving background and
GAME
OVER
rocks rolling down are conveyed
hill. If Scratch Cat touches banana, the
by depicting the objects in the far
score goes up. If Scratch Cat touched
distance small and the objects
rock, the game is over.
placed nearby big.
122
| Chapter 12
Junior Software Academy |
123
> Shy Bunny who now has two keys!
4. Shall we find out how sprites make the game work?
Banana sprite shows a rule of increasing the score
by using
touching
If
?
block and
Sensing
palette’s
Shy Bunny~
There is a door here!
But I don’t have the key
to open the door!
Ah! Can’t I pass
it just like paper
airplane?
block. Here, a variable for the score
is used and a variable is good to use to convey a
value that constantly changes according to a certain
condition or situation.
Hey guys~
I will pass the
keys~
Just like banana, the rock sprite conveys the end of game by using
block and
Sensing
is broadcast by
palette’s
broadcast
touching
?
Pat!
Pat!
우왓!
If
We got it!
We can now
escape!t
block. Here, when the end of game
, it changes the stage set to game over shape and
stops the program.
Hey guys,
Look over
there!
We finally
escaped
124
| Chapter 12
Root’s
village?!
> How was Shy Bunny able to pass the key?
Root Village
125
Design a Project
Blocks That May Be Used
Let’s design a game that connects two PCs using a sensor board.
Interacting with sound sensors
Let’s have same scratch as <rock escaping game> but this time, let’s have Heart
There are two elements that PC can transfer outside through Scratch program.
Bear be the one to be rolling the rock. You have to have Heart Bear and Scratch
The first one is the light beamed through the monitor and the sound coming
from the speaker. Let’s look into how networking becomes possible through
Cat operate on separate PCs.
Refer to Chapter 11 !
sound.
You can control the sound
by using
How can we maneuver Heart
Bear sending banana or rocks?
Input keyboard? Input mouse?
What would happen
if Heart Bear touches
the rock or eats banana?
set sound to
%
block.
Loudness-adjusted sound is
transmitted to sound sensor
on sensor board connected
to PC through speaker or
What are some methods to
network separate PCs?
Using sensor board’s sound
sensor? Using sensor board’s
slider sensor?
ear phone. Input sounds
can be sorted out by the
loudness. By using this,
it transmits two situations
including sending rocks and
Scratch Cat’s PC
Heart Bear’s PC
bananas.
After the activity
1. Write down the things you found interesting and difficult in this activity.
Now, let’s make the project!
126
| Chapter 12
2. What was the most impressive work by your friends? Let’s talk about what
you liked most about the work.
Junior Software Academy |
127