- Learnt28 min · touching colour, logs as clones, riding, the order of questions
- Basic24 min · flood the park
- Challenge 1–327 min · splash, float, ride
- Extrabonus · logs that sink
Review — every car its own speed 5 min
(my speed)is for this sprite only. Every clone keeps its own copy.- The lane stack sets the numbers, then makes the clone.
- A speed below zero drives left.
(lives)is for all sprites, reset in the stack that watches it.
Quick-fire
The frog is standing on a log. The frog wants that log’s my speed. Can it read it?
Reveal the answer
No. “For this sprite only” means only that clone can see it. The frog needs the log to tell it. That is today’s puzzle.
Today’s Topic 3 min
touching color [#2E86DE]?— the water- Logs: clones with their own speed, again
- Riding: the log tells the frog its speed
- Asking questions in the right order
Learning outcome
By the end of this lesson you will be able to:
- Detect a colour on the backdrop and make it cost a life.
- Build a second set of clones with the same pattern as the cars.
- Pass a clone’s own number to another sprite through a shared variable.
Learnt — a river to ride 28 min
The water is a colour
The park rows are now a river. The river is not a sprite. It is painted on the backdrop. So the frog cannot ask touching [River v]?. It asks about the colour instead.
- Open Sensing. Drag out
touching color [#2E86DE]?. - Click the colour swatch. A picker opens.
- Click the eyedropper at the bottom of the picker.
- Click on the river on the Stage. The swatch turns river blue.
when flag clicked
go to x: (0) y: (-160)
forever
if <touching color [#2E86DE]?> then
go to x: (0) y: (-160)
end
end
How to use this: Click the green flag, then click the Stage once and tap ↑ ↓ ← → to hop the Frog.
Logs are cars that float
A log does exactly what a car does. It is born at the end of a lane, drifts across, and deletes itself. So it is built the same way.
when flag clicked
hide
when flag clicked
forever
go to x: (-230) y: (40)
set [my speed v] to (1.5)
create clone of [myself v]
wait (4) seconds
end
when I start as a clone
show
repeat until <<(x position) > (235)> or <(x position) < (-235)>>
change x by (my speed)
end
delete this clone
(my speed) on the Log is for this sprite only, like the car’s. It is a different variable from the car’s, even with the same name.
How to use this: Click the green flag to start it. Nothing else to press — watch the logs drift, then use ↺ Reset to run it again.
Riding: which log?
When the frog stands on a log, it must move with it. The frog can ask touching [Log v]?. But that only says “yes, some log”. It does not say which one, or how fast.
The log knows its own speed. So the log writes it down where the frog can read it:
when I start as a clone
show
repeat until <<(x position) > (235)> or <(x position) < (-235)>>
change x by (my speed)
if <touching [Frog v]?> then
set [ride speed v] to (my speed)
end
end
delete this clone
if <touching [Log v]?> then
change x by (ride speed)
end
| Variable | Kind | Why |
|---|---|---|
(my speed) on Log | For this sprite only | Each log drifts at its own lane’s speed. |
(ride speed) | For all sprites | The log writes it and the frog reads it. Both must see the same box. |
How to use this: Click the green flag, then click the Stage once and tap ↑ ↓ ← → to hop the Frog onto the logs.
Ask in the right order
A frog on a log is also over the water. Its feet stick out past the log’s edges. If the frog asks about the water first, it splashes while riding.
So ask about the log first. Only if the answer is no, ask about the water. That is an if / else:
when flag clicked
go to [front v] layer
go to x: (0) y: (-160)
forever
if <touching [Car v]?> then
change [lives v] by (-1)
go to x: (0) y: (-160)
end
if <touching [Log v]?> then
change x by (ride speed)
else
if <touching color [#2E86DE]?> then
change [lives v] by (-1)
go to x: (0) y: (-160)
end
end
end
go to [front v] layer keeps the frog on top. Without it, the frog rides under the log, and you cannot see it.
How to use this: Click the green flag, then click the Stage once and tap ↑ ↓ ← → to hop the Frog across the road and the river.
Basic — flood the park 24 min
Open your game from last lesson. Test after every step.
Step 1 — paint the river
- Click the Stage, then Backdrops. Use the rectangle tool.
- Paint over the three park rows with one flat blue.
- Keep the sandy strip below it and the far bank above it.
Step 2 — splash
- Add the water check to the frog’s forever loop.
- Use the eyedropper to pick your own river blue.
- Hop into the river. It should cost a life.
Step 3 — the Log sprite
- Paint a new sprite: a long brown rectangle, about three frogs long. Call it Log.
- Make
my speedon the Log, for this sprite only. - Add the hide stack, three lane stacks and the clone stack.
Step 4 — ride speed
- Make
ride speed, for all sprites. - Add the touching-Frog check inside the log’s repeat.
Step 5 — the frog rides
- Change the water check into the if / else from Learnt.
- Add
go to [front v] layerat the top of the frog’s stack. - Stand on a log for five seconds. The frog must not splash.
Step 6 — cross it
Get from the pavement to the far bank three times.
How to use this: Click the green flag, then click the Stage once and tap ↑ ↓ ← → to hop the Frog across the road and the river.
The frog splashes while standing on a log.
The water question comes before the log question, or it is not inside the else. Ask about the log first.
The frog never splashes at all.
The colour in the block is not your river. Pick it again with the eyedropper. A gradient river will not work — paint it one flat colour.
The frog stays still while the log moves away.
ride speed is “for this sprite only” on the Log, so the frog cannot see it. Make it again, “for all sprites”.
The frog disappears when it lands on a log.
It is behind the log. Add go to [front v] layer to the frog.
The river bites
- The river is painted one flat colour.
- A hop into the water costs a life and sends the frog back.
- The sand and the far bank are safe.
How to use this: Click the green flag, then click the Stage once and tap ↑ ↓ ← → to hop the Frog.
A river of logs
- One Log sprite. Every log is a clone.
- Three river lanes, each at its own speed.
- At least one lane drifts the other way.
How to use this: Click the green flag to start it. Nothing else to press — watch the logs drift, then use ↺ Reset to run it again.
Teacher note — gaps
A gap between logs must be wider than the frog, or a gap is somewhere to stand. Speed times wait, minus the log length, is the gap. With a 130-step log at 1.5 every 4 seconds, the gap is about 50.
Ride to the far bank
- Standing on a log carries the frog at that log’s speed.
- Standing on a log is never a splash.
- Missing a log is always a splash.
How to use this: Click the green flag, then click the Stage once and tap ↑ ↓ ← → to hop the Frog onto the logs.
Teacher reveal — the other answer
The lesson has the log write ride speed. A pupil can also work it out from the frog’s own row, with no help from the log:
if <(y position) = (40)> then
change x by (1.5)
end
if <(y position) = (80)> then
change x by (-2)
end
It works, and it is worth praising. Then ask: what happens when lane 2 speeds up? Now the number lives in two places. The log telling the frog keeps it in one.
Logs that sink
Make the river trickier. Some logs sink for a moment, then come back up.
- About one log in three is a sinker. The rest never sink.
- A sinker hides for one second, every few seconds.
- A frog on a log when it sinks goes splash.
How to use this: Click the green flag, then click the Stage once and tap ↑ ↓ ← → to hop the Frog across.
Teacher reveal — the second clone stack
when I start as a clone
if <(pick random (1) to (3)) = (1)> then
forever
wait (2) seconds
hide
wait (1) seconds
show
end
end
The forever loop ends when the clone deletes itself — deleting a clone stops all of its stacks. A pupil who worries it runs for ever has asked exactly the right question.
Summary 5 min
touching color [#2E86DE]?finds something painted on the backdrop. Paint it one flat colour.- A new kind of clone uses the same pattern: parent, lane stacks, clone stack.
- A clone’s own number can be passed on: it writes it into a for all sprites variable.
- Ask questions in the right order. Log first, water only if there is no log.
- touching color
- A Sensing block that asks if the sprite is over a colour.
- Eyedropper
- The tool that picks a colour by clicking on the Stage.
- Ride speed
- A shared variable the log writes and the frog reads.
- if / else
- Two paths: one when the answer is yes, one when it is no.
Hand in
Share your game and send the link to your teacher. Next lesson the far bank becomes home: levels, a score, faster lanes and a win screen.