Mada za sehemu hiiDesign simple computer programmesMada 1
- Develop simple games that use more than two shapes using a block-based programming languages
In this lesson, you will learn how to use a block-based programming language to create simple games that include more than two different shapes. By the end, you will be able to build a game where shapes work together to make the game fun to play.
A block-based programming language is a way to create computer programs by connecting colorful blocks together, like building with LEGO pieces. You do not need to type complex code. Instead, you drag blocks and snap them to tell the computer what to do.
The most popular block-based programming language for beginners is called Scratch. In Scratch, you can create animations, stories, and games using blocks that look like puzzle pieces.
When you create a game with only two shapes, the gameplay is usually very simple. By adding more than two shapes, you can:
- Make the game more interesting and challenging
- Create different characters or objects that do different things
- Teach players about different shapes while they play
- Build games that look more like the real world
For example, a game about Tanzanian football could have:
- A circle (the ball)
- A rectangle (the goalpost)
- A triangle (the flag at the corner)
Step 1: Open the Programming Tool
- Go to a computer and open Scratch (or any similar block-based programming app)
- Click on "Create" to start a new project
Step 2: Choose Your Shapes
Think about the game you want to make. For a simple game, you need at least three different shapes. Let's create a simple game where a ball (circle) must reach a goal (rectangle) while avoiding an obstacle (triangle).
In Scratch, you can:
- Draw your own shapes using the costume editor
- Use the shape tools to create circles, rectangles, and triangles
Step 3: Add the Shapes to Your Project
- Click on "Choose a Sprite" to add characters
- Select or draw a circle (ball) — this will be your player
- Add a rectangle (goal) — this will be the target
- Add a triangle (obstacle) — this makes the game challenging
Step 4: Write the Instructions (Blocks)
Now you connect blocks to tell each shape what to do. Here is a simple example:
For the Circle (Player):
- When the green flag is clicked
- Move 10 steps
- If touching the rectangle, say "Goal!" and stop
For the Rectangle (Goal):
- When the green flag is clicked
- Stay in position
- If touching the circle, change the score
For the Triangle (Obstacle):
- When the green flag is clicked
- Move up and down
- If touching the circle, send player back to start
Step 5: Test Your Game
- Click the green flag to run your game
- Check if all three shapes are working together
- Fix any problems by adjusting your blocks

Imagine you want to create a game where a basket catches falling fruits. Here is how you could use more than two shapes:
| Shape | Object in Game | What It Does |
|---|---|---|
| Rectangle | Basket | Moves left and right at the bottom of the screen |
| Circle | Orange | Falls from the top; player must catch it |
| Triangle | Banana | Falls from the top; player must avoid it |
How the game works:
- The rectangle (basket) follows your arrow keys to move left and right
- The circle (orange) falls down slowly
- If the basket catches the orange, you get points
- If the basket touches the triangle (banana), you lose points
This game uses three different shapes, each doing a different job. This makes the game more fun and teaches players about shapes while they play!
- Block-based programming languages let you create games without typing code
- A simple game needs at least three different shapes working together
- Each shape should have its own set of blocks telling it what to do
- Test your game often and fix problems as you go
- Use shapes that make sense for your game story
In Tanzania, you can see block-based programming being used in schools that have computer labs. For example, at a primary school in Dar es Salaam or Arusha, students can create their own simple games during their ICT lessons. If you create a game about selling fruits at a local market (like the ones at Kariakoo), you could use a rectangle to show the stall, circles for oranges, and triangles for pineapples — and share your game with friends to practice counting and shape recognition while playing!
Swali
Which of the following is an advantage of using simple games in learning?
Ingia ili kuwasilisha jibu lako na lihesabiwe katika umahiri wako.
Ingia ili kufanya mazoeziMwalimu
Umekwama? Niulize chochote kuhusu mada hii.
Ingia ili kumuuliza Mwalimu wa AI wa Sonza kuhusu swali hili.
Ingia ili kuuliza