0% found this document useful (0 votes)
27 views11 pages

Lesson 4 - Flowcharts

1. The document provides instructions for a coding lesson that teaches using flow diagrams and broadcast messages in Scratch projects. 2. Students will create flow diagrams to plan scripts and use broadcast messages to communicate between sprites. More advanced students will create complete flow diagrams including decision boxes and adapt scripts. 3. The instructions demonstrate creating a flow diagram for a maze game that uses broadcast messages to signal when the player reaches the end of one level to trigger moving to the next level.

Uploaded by

Saarah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views11 pages

Lesson 4 - Flowcharts

1. The document provides instructions for a coding lesson that teaches using flow diagrams and broadcast messages in Scratch projects. 2. Students will create flow diagrams to plan scripts and use broadcast messages to communicate between sprites. More advanced students will create complete flow diagrams including decision boxes and adapt scripts. 3. The instructions demonstrate creating a flow diagram for a maze game that uses broadcast messages to signal when the player reaches the end of one level to trigger moving to the next level.

Uploaded by

Saarah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 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