انتقل للمحتوى
Robo EgyptRobo Egypt
☰ Course contents

We build the blocks

Section 13: The final project: catch the appleLesson 13.2 · ⏱ 20 min
All the blocks, as they ran in the lab
All the blocks, as they ran in the lab

The timer: every 0.05 seconds

As long as the hearts are more than 0: the apple goes down by speed, and the basket moves with the tilt. If the apple reaches the bottom of the canvas the hearts go down one, the lose sound plays, and the apple goes back to the top. When the hearts become 0 “Game over! Your score …” appears.

Touching

The points go up one, a note plays, and the apple goes back to the top in a random place. The remainder score mod 3 = 0 means “every 3 apples”: we add 2 to the speed and show “New level! 🚀”.

The “Again” button

It puts the three variables back to their first values, takes the apple back to the top, and writes “🍎 0 ❤️ 3”.

📌 Another example: a sound for every event

Catching: a high note. Falling: a lose sound.

The design
The design
The blocks
The blocks
In the lab: playing
In the lab: playing
✍️ Practise
Make the example yourself: put the parts in “🎨 Design”, then the blocks, and tap ▶ Run.
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

Every apple you catch adds a point and writes it.

👀 Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: the points go up.

Medium

An apple that falls takes away a heart.

👀 Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: the hearts go down.

Hard

When the hearts run out a “Game over” message appears with the score.

👀 Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: Game over!

Finished the lesson? Mark it so your progress counts.