Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

Scratch

Lesson 1

1
Starter
Draw a flow diagram
for the code on the
starter sheet.
Here is a reminder of
the shapes you can
use.

2
Objective of the lesson
Create flow diagrams to help plan your script and
use broadcast messages in your code.

• All of you will:


– Create a simple, partially complete flow diagram.
• Most of you will:
– Create a complete flow diagram including decision boxes.
– Use broadcast messages to communicate between sprites.
• Some of you will:
– Adapt and improve the script.

3
START

Starter Points = 0

Move 10 steps

Is the sprite
touching the
enemy?

Yes

Points = Points -1

Turn 15 degrees
clockwise

Move 10 steps

4
Create a flow Chart
• When the green flag is
clicked, go to coordinates x
-205, y -142
• Forever check:
– If it touches the colour black,
go to coordinates x -205, y -
142 and reduce lives by 1
– If it touches the colour
yellow, say next level for 2
seconds
• When the green flag
START is clicked and go to x-
205, y-142
Go to -205, -142 • Forever
– If it touches the
colour black, go to
coordinates x -205,
y -142
– If it touches the
Is the sprite Yes colour yellow, say
touching Go to -205, -142
black? You win for 2
seconds
No

No Is the sprite
touching
yellow?

Yes
Say “You Win”
Create the code
• Create a new
project.
• Change the sprite to
one of your choice.
• Change the stage to
a maze – make sure
your lines are black
and the end point is
yellow
Broadcast messages
• A broadcast message is a message that is sent
out to all objects in the project.
• This message can notify them that something
has happened and they need to act.
• We are going to use a broadcast message to
get to the next level when the user has
touched the end point
Change the code
• Change the code so that
once the “You Win”
statement has been printed
it will broadcast a message
called Level2.
• Note: the name of the
broadcast message does not
include spaces and uses
capital letters to show where
the words start.
Create a stage sprite
• Add a second stage of
your choice.
• Make the maze more
difficult than the first
and use a DIFFERENT
colour for the end
point, same colour for
the walls
How much do you remember?
• Create a new project.
• Delete the cat sprite and add another of your choice.
• Make your new sprite move when you use the arrow keys.
• Add a second sprite of your choice.
• Make it move around and bounce off the screen.
• Make a variable called Score.
• If the second sprite touches the first sprite add 1 to the
score and broadcast the message HideNow.
• When the first sprite receives the HideNow message, it
hides for 2 seconds and then shows again.

You might also like