- Learnt27 min · random monsters, orders, the and check
- Basic25 min · open the shop
- Challenge 1–327 min · surprise, order, serve
- Extrabonus · rush hour
Review — where we got to 5 min
- One broadcast can start every part at once.
- Layers decide which sprite covers which.
broadcast [trick v] and waitwaits until every part has finished.- The green flag does not reset layers or effects — your scripts do.
Quick-fire
Every part has a variable holding its costume number: head, body, legs. There is also colour. How many numbers describe one whole monster?
Reveal the answer
Four. Say four numbers and anyone can rebuild your monster. Today a customer says four numbers, and you build it.
Today’s Topic 3 min
- A random monster with
(pick random (1) to (4)) - A random colour that always has a name
- An order: four “want” numbers and a card that draws them
- A check that joins four questions with
<<> and <>> - A count of orders filled, and a new order each round
Learning outcome
By the end of this lesson you will be able to:
- Pick a random costume for each part, and a random named colour.
- Make a random order and show it as a picture.
- Check four things at once with and, and act on the answer.
Learnt — a monster shop 27 min
Everything you built in this arc is a number: three costume numbers and a colour. Today the game makes those numbers up, and then checks them.
1 · A random monster
(pick random (1) to (4)) is in Operators. Drop it into the costume slot and the part picks one of its four costumes.
when this sprite clicked
start sound [Magic Spell v]
set [colour v] to ((pick random (0) to (3)) * (50))
broadcast [random v]
when I receive [random v]
switch costume to (pick random (1) to (4))
set [head v] to (costume [number v])
Why not pick the colour from 0 to 200? Try both in your head.
(pick random (0) to (200))might give 137. That colour has no name, and nobody could ever ask for it.((pick random (0) to (3)) * (50))can only give 0, 50, 100 or 150: green, blue, pink or orange.
Each part still has last lesson’s forever loop, so it takes the new colour on its own.
when flag clicked
go to x: (0) y: (65)
switch costume to [one eye v]
set [head v] to (costume [number v])
forever
set [color v] effect to (colour)
end
How to use this: Click the green flag, then click the wand on the stage for a random monster.
2 · The order
A customer’s order is four more random numbers. Make four variables for it: want head, want body, want legs and want colour.
The customer is Gobo, from the library. You met Gobo in Choose Your Path.
when I receive [new order v]
set [want head v] to (pick random (1) to (4))
set [want body v] to (pick random (1) to (4))
set [want legs v] to (pick random (1) to (4))
set [want colour v] to ((pick random (0) to (3)) * (50))
broadcast [show order v]
say (join (want head) [ eyes, please!]) for (2) seconds
Numbers alone are hard to build from. So the order card draws a small monster: three mini sprites, each a copy of a part.
- Paint a Card sprite: a white rectangle. Put it top-right.
- Right-click the Head in the Sprite list and choose duplicate. Name it Mini head.
- Delete all of Mini head’s scripts. Set its size to 40.
- Give it the stack below, and place it on the card.
- Do the same for Mini body and Mini legs.
when I receive [show order v]
switch costume to (want head)
set [color v] effect to (want colour)
How to use this: Click the green flag, then click Gobo on the stage for a new order.
3 · The check: four questions, three ands
<<> and <>> asks two questions. It says yes only if both are yes. You used it on the castle door.
We have four questions. Build the answer from the inside out.
- One question:
<(head) = (want head)>. - Two questions:
<<(head) = (want head)> and <(body) = (want body)>>. - Build a second pair for legs and colour, the same way.
- Drop both pairs into a third and. Four questions, one answer.
when this sprite clicked
if <<<(head) = (want head)> and <(body) = (want body)>> and <<(legs) = (want legs)> and <(colour) = (want colour)>>> then
start sound [Cheer v]
change [orders v] by (1)
say [Order filled!] for (1) seconds
broadcast [new order v]
else
say [Not quite!] for (1) seconds
end
4 · Counting the orders
A variable orders counts every order filled. Gobo sets it to 0 and asks for the first order.
when flag clicked
set [orders v] to (0)
broadcast [new order v]
Right-click the orders readout and choose large readout. The player only needs the number.
Basic — open the shop 25 min
Start from your maker. The dance can stay; the arrows can go if the Stage is busy.
How to use this: Click the green flag. Click the head, body or legs on the stage to change them, the paint pot for the colour, the wand for a surprise, and the bell to serve.
Step 1 — a paint pot
- Paint a pot of paint in your monster’s colour. It follows
colourtoo. - Give it the two stacks below.
- Click it four times: green, blue, pink, orange, and green again.
when flag clicked
set [colour v] to (0)
forever
set [color v] effect to (colour)
end
when this sprite clicked
change [colour v] by (50)
if <(colour) = (200)> then
set [colour v] to (0)
end
Step 2 — the wand
- Add the Wand sprite and the sound Magic Spell.
- Give it its stack, and give every part its random receiver.
Step 3 — the customer and the card
- Make the four want variables and orders.
- Add Gobo with both stacks, then the Card and the three minis.
- Press the flag. Gobo should ask, and the card should fill in.
Step 4 — the bell
- Add the Bell and the sound Cheer.
- Build the check from the inside out, one and at a time.
- Ring it before you build anything. It must say Not quite!
- Build the order and ring again. Cheer, count, next order.
The monster matches, but the bell says Not quite!
One of the four numbers is wrong. Look at the readouts: is colour 100 when the card is pink? Is a part’s number noted after it changes?
The mini monster is always green.
Its set [color v] effect to (want colour) is missing, or it reads colour instead of want colour.
The minis copied the part’s dance and clicks.
Duplicating a sprite copies its scripts. Delete everything on each mini except the show order stack.
The count goes up by two.
The bell was clicked twice while it was talking. That is allowed — but only if both clicks really matched. If they did not, check the order of your blocks.
Surprise me
A wand that makes a random monster.
- Every part picks a random costume.
- The colour is random, but always one of your four.
- The four numbers on the Stage match the new monster.
The order card
A customer, an order, and a picture of it.
- The green flag brings the first order.
- The customer says how many eyes.
- The card shows a small monster in the wanted colour.
Teacher note
Watch for a mini with the full-size part’s scripts still on it: it dances, it answers the wand, and the order changes under the player’s nose.
Order up!
The bell checks your monster against the order.
- Four things must match: head, body, legs and colour.
- A match cheers, counts one, and brings a new order.
- Anything else says Not quite! and counts nothing.
Teacher reveal — building the and
The block the pupil drags in last is the outer and. Most get stuck dropping a comparison into the wrong half. Have them build the two pairs as separate blocks on the script area first, test each by clicking it, then join them.
<<(head) = (want head)> and <(body) = (want body)>>
Click this on its own and it says true or false. That is the check, half built.
Rush hour
Sixty seconds. Fill as many orders as you can.
- The shop closes after 60 seconds.
- Gobo says how many orders you filled.
- A best score stays, even after the green flag.
How to use this: Click the green flag. Click the parts, the paint pot and the wand on the stage to build the order, then the bell to serve. Sixty seconds.
Teacher reveal — the clock
when flag clicked
reset timer
wait until <(timer) > (60)>
broadcast [time up v] and wait
stop [all v]
when I receive [time up v]
if <(orders) > (best)> then
set [best v] to (orders)
end
say (join [Time's up! Orders: ] (orders)) for (2) seconds
Summary 5 min
(pick random (1) to (4))in a costume slot picks a random costume.- Multiply a small random number to land only on values that mean something.
- An order is a set of numbers. A picture of it is easier to build from.
<<> and <>>says yes only when both sides do. Nest them to check four things.
What the Monster Maker covered
- Costumes as choices, and the costume number as data.
- All seven graphic effects, driven by variables and sliders.
- One broadcast to many sprites, layers, and a ghost fade.
- Random choices, and a check that joins four questions.
- Random
- Chosen by the computer, so you cannot know it in advance.
- Order
- The four numbers the customer wants.
- And
- A question that is true only if both its questions are true.
- Match
- Every number you built is the number that was asked for.
Hand in
Share your finished monster shop and send the link to your teacher. That is the Monster Maker done — next lesson starts the Times-Table Challenge.