Your First Game
You already know four ideas: order, repeating, “if” and a box with a name. Today you put them together — and a game comes out!
For parents: a one-page guide — dinner questions and a game without a screen.
01Remember
Think about each question first, then open the answer.
How do you tell a robot “take 4 steps” without writing “step” four times?
With repeating (loop): “repeat 4 times — step”. The blocks do the same thing again and again.
What is the “if… then…” block for?
For a decision (if). Like “if it rains — umbrella”: the block does something only when the condition is true.
What is a variable?
A box with a name (variable). A number sits inside, and you can change it, for example “points = points + 1”.
02Story
In 1972 the company Atari released a game called “Pong”. On the screen there are two little bars and a ball. Each player moves their bar up and down to bounce the ball back.
There are only a few rules. If you hit the ball, it bounces. If you miss it, the other player gets a point. The points are counted in one variable. And the ball flies again and again until the game ends.
See? A few ideas put together — and that is a whole game. Today you do the same with stars.
03Worked example
The game “Catch the Star” is built from these blocks. Each idea has its own colour.
Here is one round, step by step:
Order (sequence)
The blocks go one after another: first the points become 0, then the game starts, and at the end the result is shown.
Repeat (loop)
The block “repeat 10 times” runs everything inside it ten times. One round is one star.
“If” (if)
When the star reaches the bottom, the program checks: is the basket under it? If yes — it adds a point. If not — the block does nothing.
Box (variable)
“Points” is a box with a name. It starts at 0. After two caught stars it holds 2. The number changes, but the name stays.
The computer does not know this is a game. It only follows the blocks — exactly and fast.
04Try it
1 · Predict
The basket is not under the star when it lands. What does the “if” block do?
2 · Run: “Catch the Star”
Press ▶ Start. The star falls down. Move the basket 🧺 with the ◀ ▶ buttons, with the arrow keys (click in the grid first) or by tapping a column. The block that is running right now lights up.
The game runs only on this page. Nothing is sent and nothing is saved. It ends after 5 or 10 rounds, and you can start it at most 3 times per page.
3 · Change
Change one setting and play again. First predict: if you catch 4 stars and each is worth 3 points — how many points will you have? Check it.
The settings are like the blocks: you put other numbers into “repeat” and “points + …”, and the game changes. What happened to the points? What happened when you changed the speed?
05No screen: “Catch the Star” on paper
You need: a sheet of paper, a pen, a bottle cap (the basket), a die and one more person.
Draw 5 squares in a row and number them 1 to 5. Put the cap on square 3. On another sheet write: points = 0.
One round: you move the cap at most one square left or right. Then the other person rolls the die. The number is the star's column. If it shows 6 — roll again.
If the cap is on the same square — cross out the old number on the points sheet and write the new one (points + 1). If not — do not touch the sheet.
Repeat the round 10 times. Then say out loud: “The end! Points: …”
Invent a new rule: for example, on squares 1 and 5 a star is worth 2 points. Which blocks of the game does that change?
06Make your own
Invent your own game with the same four ideas.
- What falls? It can be an apple, a raindrop or a snowflake.
- What catches it? A basket, an umbrella, a hat…
- Write the “if” rule: when do you get a point?
- What is your box called? When does the number in it go up, and when does it go down?
- Invent a surprise: “If you catch a golden star — points + 5.”
Draw the blocks on paper, each in the colour of its idea, and show someone at home how your game works.
07What I learned
- Games are built from a few ideas: order, repeating, “if” and a box with a name.
- The “if” block works only when its condition is true.
- When you change a number in a block, the game behaves differently.
The game says “time for a break” when it ends. How do you know when it is time for a break?
Check yourself
1. Which block makes the program do the same thing again and again?
2. What does the block “if the basket is under the star” do?
3. What is “points” in our game?
It is yours when you can show someone where the game has order, repeating, “if” and a box. No points and no rankings — just a skill.
08I have a question
Do you still have a question? Write it here. It goes to your parent, not to strangers. Your parent confirms their e-mail first.
The form is loading… If it does not appear, write your question on paper and show it to a parent or teacher.
·Sources
- Title: Your First Game (DB-BL-05) · Author: Children's Library, East Accelerator Foundation · Source: original content and original code of the mini game, 2026 · Rights: CC BY-SA 4.0.
- The story: the general history of video games (the game “Pong”, Atari, 1972).
- Scratch: only a link to scratch.mit.edu (created at the MIT Media Lab; since 2019 the Scratch Foundation). We do not copy its code, pictures or characters. “Scratch” and the Scratch Cat are trademarks of their owners.
- School link: Bulgarian curriculum, Computer Modelling, grade 4 — creating educational games.
- Licence: CC BY-SA 4.0 · Children's Library, East Accelerator Foundation, 2026. You may share and adapt this lesson if you credit the author and keep the same licence. Learning is free forever.