Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
← Fundamentals of Game Development Level One · Lesson 8 of 9

Module Seven

📖 Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
8
Module Seven: Introduction to Coding with Blocks

Module Seven: Introduction to Coding with Blocks

Hello, young coder! You have already learned how to think like a game developer. You made plans, drew sprites, and designed levels. Now it is time to bring those ideas to life inside a computer. In this module, you will learn to talk to the computer using colorful blocks. It is like playing with digital Lego. Let’s build something amazing together!

Module Introduction

Do you remember the Game Loop from Module Six? The loop that goes Input, Update, Render? To make that loop actually work on a screen, we need to give the computer a set of instructions. Giving instructions to a computer is called coding or programming.

Now, you might think coding is typing lots of weird green text on a black screen. Not anymore! Today, we use something called block coding. Block coding means you drag colorful puzzle pieces and snap them together. Each block is an instruction. If the blocks snap together, the instruction works! It is like telling a story with pictures instead of hard words.

This module will teach you the fundamentals of block coding. You will learn how to make a character move, how to make it talk, and how to check if it touches something. By the end, you will have built your very first interactive digital game. All you need is curiosity and the ability to play with shapes. Let’s jump in!

Learning Objectives

By the time you finish this module, you will be able to:

  • Explain what block coding is in your own simple words.
  • Understand and use the three basic block types: Event, Action, and Control.
  • Describe what a sequence is and why order matters.
  • Use a loop to repeat an action many times.
  • Use a condition (an “if” block) to make a decision in code.
  • Define a variable as a box that holds a number or a word.
  • Move a sprite using the X and Y coordinates.
  • Create a simple clicker game using block logic.
  • Debug a simple block sequence when it does not work.

Warm-up Story: Amara and the Robot Chef

Amara was Kola’s little sister. After watching Kola make his dirt game, she wanted to build something too. But Amara loved cooking more than running. She dreamed of a robot chef that could make puff-puff for the whole family.

She took a big paper and drew squares. In the first square, she wrote “Wake up.” In the second, “Check if there is flour.” In the third, “If yes, mix flour and sugar. If no, shout for Mum.” She connected the squares with arrows. It looked like a treasure map of instructions.

Her big brother Kola looked at it and laughed. “Amara, you just wrote a program! You are a coder!” Amara did not know what coding meant. She just knew she was telling a robot exactly what to do, step by tiny step. When she got a tablet from school, she opened a block coding app. The blocks looked exactly like her paper squares! She dragged a “start” block, then a “check” block, then a “say” block. Her robot chef was born on screen. It did not fry real puff-puff, but it showed an animation of it! Amara had become a coder without even realizing it. And so have you.

Main Lessons

Lesson 1: What Is Block Coding?

Definition: Block coding is a way of programming where you use visual, colorful blocks that snap together instead of typing complicated text.

Why it is important: Typing text code is hard because a missing dot or comma can break the whole game. Blocks fit only if they make sense. This lets you focus on the logic, not on spelling strange words.

Simple explanation: Imagine you have a box of toy train tracks. Some pieces are straight, some are curves. You cannot snap a curve onto a straight piece upside down. The pieces only fit if the connection is right. Block coding works the same way. Each block is a piece of track. Your train (the computer) follows the track you built.

Real-life example: A picture-based instruction manual for a bookshelf. It shows step 1, step 2, step 3 with clear icons. No confusing words.

School example: A visual timetable on the classroom wall. The Monday block shows a picture of a math book, then a break apple, then an English book.

Home example: A chore chart with pictures. Brush teeth, make bed, eat breakfast. Each is a block.

Nigerian example: Think of the street signs in Lagos. A “no parking” sign is a clear visual block that gives an instruction. Block coding is just a row of signs telling the computer what to do.

Illustration:

    [Start]---->[Move 10 steps]---->[Say Hello!]---->[Stop]
       ^            ^                    ^              ^
    Event        Action               Action        Control
    

Mini Summary: Block coding is dragging, dropping, and snapping colorful instruction blocks together. It is coding without the typing pain.

Lesson 2: The Three Families of Blocks: Event, Action, Control

Definition: Almost every block belongs to one of three families: Events (when to start), Actions (what to do), and Control (how the flow works).

Why it is important: If you can spot these three families, you can read any block code in the world, even if you don’t know the exact app.

Simple explanation: Think of a school day. Event: The bell rings. Action: You stand up and walk to the next class. Control: You walk only if the bell is for your class; else, you stay. Events start the magic. Actions do the magic. Control decides the path of the magic.

Real-life example: A traffic light. Event: Light turns green. Action: Car moves forward. Control: If the light stays green, keep moving; if it turns yellow, slow down.

School example: Event: Teacher asks a question. Action: You raise your hand. Control: Wait if someone else is speaking.

Home example: Event: Baby cries. Action: Mum picks the baby up. Control: If the baby is hungry, feed; if wet, change diaper.

Nigerian example: A conductor in a danfo bus. Event: A passenger waves. Action: Conductor shouts "Stop!". Control: If the bus is full, don't stop.

Illustration:

    +----------------+   +----------------+   +----------------+
    |  EVENTS        |   |  ACTIONS       |   |  CONTROL       |
    | (When)         |   | (What)         |   | (How)          |
    +----------------+   +----------------+   +----------------+
    | when green     |   | move 10 steps  |   | repeat 10 times|
    | when clicked   |   | say "Hello!"   |   | if... then...  |
    | when key pressed|  | change color   |   | wait 1 second  |
    +----------------+   +----------------+   +----------------+
    

Mini Summary: Events start, Actions happen, Control manages the flow. Every program is a mix of these three families.

Lesson 3: Sequence – The Order Matters!

Definition: A sequence is the exact order of instructions. The computer follows the blocks one after the other, from top to bottom.

Why it is important: If you put your socks on after your shoes, your feet will hurt. If you tell the computer to “Say Goodbye” before “Say Hello,” the story makes no sense. The order is everything.

Simple explanation: A sequence is like a recipe. Step 1: Crack the egg. Step 2: Mix. Step 3: Fry. You cannot fry before you crack the egg. Code works the same stubborn way. It reads top to bottom.

Real-life example: A morning routine: Wake up, then brush teeth, then eat breakfast. You cannot eat breakfast before waking up!

School example: Solving a math problem: First read the question, then write the formula, then calculate, then write the answer.

Home example: Making tea: boil water, put tea bag in cup, pour water, add milk.

Nigerian example: Pounding yam: First boil the yam, then peel it, then pound in the mortar. Do it in the wrong order and you get a mess!

Illustration:

    Correct Sequence:
    [Start]-->[Move]-->[Turn]-->[Jump]-->[End]

    Wrong Sequence:
    [Start]-->[Jump]-->[Turn]-->[Move]-->[End]
    (Character jumps into a pit because it didn't turn away first!)
    

Mini Summary: The computer reads your blocks in strict order, like a bossy chef reading a recipe. Make sure the steps are in the right sequence.

Lesson 4: Loops – Doing Things Again and Again

Definition: A loop is a block that repeats one or more actions. You tell it how many times to repeat, or you tell it to repeat forever.

Why it is important: Without loops, you would need to drag the “walk” block 100 times to cross a room. A loop says “walk 100 times” in just one block. It saves time and makes the game loop possible.

Simple explanation: Your heart loops. It goes thump-thump, thump-thump, forever. It does not do one thump and stop. A game loop repeats the input, update, render sequence forever until you quit.

Real-life example: A skipping rope. You swing the rope, jump, swing, jump. This is a loop until you trip.

School example: Writing lines as punishment: “I will not talk in class.” You write it 50 times. That is a loop.

Home example: Washing plates: Pick plate, scrub, rinse, stack. Repeat until no plates left.

Nigerian example: A woman frying akara balls. She scoops batter, drops in oil, waits, removes. She loops this until the batter bowl is empty.

Illustration:

    +----------------------------+
    | REPEAT 4 TIMES             |
    |   [Move 10 steps]          |
    |   [Turn Right 90 degrees]  |
    +----------------------------+
    Result: A square path!
    

Mini Summary: A loop is a repeat machine. Use it when you want the computer to do something many times without getting bored.

Lesson 5: Conditions – Making Choices with “If”

Definition: A condition is a yes-or-no question the computer asks. The “If” block runs the code inside it only if the answer is YES (true).

Why it is important: Games need decisions. “If the player touches the coin, increase score. If the player touches the lava, end the game.” Without conditions, games cannot be interactive.

Simple explanation: Imagine a security guard at a gate. He checks every person. “If you have a ticket, enter. Else, go home.” The guard is an “If-Else” block. The question “Do you have a ticket?” is the condition.

Real-life example: Weather check. “If it is raining, take an umbrella. Else, wear sunglasses.”

School example: “If your score is above 80%, you get a gold star. Else, try again.”

Home example: “If the phone battery is less than 10%, plug it in. Else, keep playing.”

Nigerian example: A bus driver at a checkpoint. “If it is a soldier waving, stop. Else, keep driving.”

Illustration:

         +------> [Is key pressed?] --YES--> [Move character]
         |                     |
         |                     NO
         |                     |
         +-------<-- (Wait) <--+
    

Mini Summary: “If” blocks make games smart. They let the computer make decisions based on what is happening right now.

Lesson 6: Variables – Boxes for Your Stuff

Definition: A variable is a named box in the computer’s memory where you can store a number or a word. You can look inside, change what’s inside, or use it later.

Why it is important: A game needs to remember things: your score, your name, how many lives you have left. Variables are the memory of the game.

Simple explanation: Think of a locker in school. You put your bag inside and close the door. The locker has a label: "Amara’s Locker." The label is the variable name. The bag inside is the value. You can swap the bag for a lunchbox, and the value changes, but the label stays.

Real-life example: A bank account. The balance is a variable. When you put money in, the number goes up. When you buy something, it goes down.

School example: A class register. The list of names is a variable that holds the names of all students present today.

Home example: The shopping list stuck to the fridge. You write items down (store). You cross them off (change). You read what is next (use).

Nigerian example: A market trader’s record book. The book page for "Tomatoes" has a number. As she sells, the number reduces. As she restocks, the number increases. The page is a variable.

Illustration:

    +---------------------+
    | Variable: Score     |
    | Value: 0            |
    +---------------------+
        |
        | (Player eats coin)
        v
    +---------------------+
    | Variable: Score     |
    | Value: 10           |
    +---------------------+
    

Mini Summary: A variable is a storage box with a name. It remembers numbers or words for your game.

Lesson 7: Moving Sprites with Coordinates

Definition: In block coding, you can change a sprite’s X and Y coordinates using action blocks. This is how characters walk, fall, and fly on screen.

Why it is important: Remember Module Six? We said games are just changing numbers and redrawing. Here, we actually change those numbers with blocks.

Simple explanation: The screen is a giant graph paper. The cat sprite is sitting at (0,0). You grab a “change X by 10” block and snap it under a “when right arrow pressed” event. Every time you press the right arrow, the cat’s X goes up by 10 pixels. It slides to the right!

Real-life example: Moving a magnet on a fridge door. Each push changes its position a little bit.

School example: A marker on a whiteboard. The teacher wipes it and draws in a new place. The coordinate of the drawing changed.

Home example: A toy car on a playmat. Your hand pushes it from one street to another.

Nigerian example: A boat on the Lagos Lagoon. The boatman paddles, and the boat's position (coordinate) changes relative to the shore.

Illustration:

    Event: [When Right Arrow Key Pressed]
         |
         v
    Action: [Change X by 10]
         |
         v
    Result: Sprite slides right
    

Mini Summary: We bring sprites to life by connecting key press events to “change X” or “change Y” blocks. Every button tap adds or subtracts to the coordinate.

Lesson 8: Collision Detection in Blocks

Definition: Block coding has special sensing blocks that ask “Am I touching this sprite?” or “Am I touching this color?” These are used to detect collisions.

Why it is important: This is the block version of our collision lesson. It lets you collect coins, hit enemies, and open doors.

Simple explanation: You place a “touching [object]?” block inside an “If” block. It becomes the question. “If I am touching the coin sprite, then change score by 1 and hide the coin.”

Real-life example: A goalkeeper’s gloves touching the ball. The referee (the computer) checks: Did the glove touch the ball? Yes. Save!

School example: Playing dodgeball. A player asks themselves: “Did the ball touch me?” If yes, they are out.

Home example: A cat pawing at a toy mouse. The cat’s brain: “If paw touches mouse, then pull it closer.”

Nigerian example: Playing “Tinko Tinko” (a clapping game). Your hands must meet. Your brain detects the collision of your two hands.

Illustration:

    Event: [Forever Loop]
         |
         v
    Control: [If touching "Coin"?]
         |
        YES ---> [Change Score by 1]
                   [Play sound "Ding"]
                   [Hide Coin]
         |
         NO ----> (Do nothing)
    

Mini Summary: Use the touching block inside an if-block. This is the magic recipe for collecting anything in a game.

Lesson 9: Broadcasting – Sending Secret Messages

Definition: A broadcast is a message one sprite sends to all other sprites or the stage. It is like shouting in a room. Anyone listening can react.

Why it is important: Sprites need to talk to each other. When the boss monster dies, it must broadcast “I’m dead!” so the gate sprite opens. Without broadcasts, sprites are lonely islands.

Simple explanation: Think of a football referee blowing a whistle. The whistle is a broadcast. Every player hears it and stops. The referee did not tap each player on the shoulder. He just sent a sound message to all.

Real-life example: A school bell. It broadcasts “Class is over!” to the whole school. Students react (pack bags), teachers react (stop teaching).

School example: Morning assembly. The drum or gong sounds. Everyone runs to the field.

Home example: A smoke alarm beeping. It broadcasts “Danger! Smoke!” to everyone in the house.

Nigerian example: A town crier in the village. He beats the gong and shouts a message. Everyone hears the broadcast and gathers.

Illustration:

    Sprite 1 (Boss): [Broadcast "Game Won"]
                        |
        +---------------+---------------+
        |               |               |
        v               v               v
    Sprite 2 (Gate): Sprite 3 (Music): Sprite 4 (Score):
    [When I receive   [When I receive   [When I receive
     "Game Won"]       "Game Won"]       "Game Won"]
    [Open]             [Play Victory]    [Show Final Score]
    

Mini Summary: Broadcast blocks let sprites talk to each other wirelessly. One shout, many reactions.

Lesson 10: Clones – Making Copies of Sprites

Definition: A clone is a perfect copy of a sprite that appears during the game. You can have one original sprite, but create a hundred copies of it while the game runs.

Why it is important: Think of a space shooter game. Hundreds of asteroids come at you. You do not draw 100 separate sprites. You have one asteroid sprite and you clone it 100 times.

Simple explanation: You have one sheet of gold star stickers. You want to give a star to 20 friends. You have only one design, but you make 20 copies (clones) and hand them out. The original sheet stays safe.

Real-life example: A photocopier machine. You put one paper in, press copy, and it makes many identical pieces of paper.

School example: Your teacher prints a worksheet. One original digital file, but 30 printed copies for the class.

Home example: Baking cookies with a single star-shaped cutter. The dough is the raw material, and you stamp out many star cookies.

Nigerian example: A textile maker using one wooden stamp to print the same pattern many times on a long cloth.

Illustration:

    Original Sprite (Coin)
        |
        v (When Green Flag Clicked)
    Repeat 10 times:
       [Create Clone of Myself]
       [Move Clone to Random Position]
    

Mini Summary: Clones let you create an army from one sprite. Great for coins, enemies, or falling stars.

Lesson 11: User Interface (UI) – Buttons and Scoreboards

Definition: UI, or User Interface, are the parts of the game the player sees and touches to control things or get information. This includes buttons, score text, health bars, and menus.

Why it is important: A game without a scoreboard is confusing. How do you know if you’re winning? A game without a start button doesn’t feel like a game. UI connects the player’s eyes and fingers to the game logic.

Simple explanation: Imagine a TV remote. The rubber buttons are the UI. The screen showing the channel number is the UI. Without them, you would be stabbing in the dark.

Real-life example: A car’s dashboard. The speedometer, fuel gauge, and radio buttons are all UI.

School example: Your report card. The names of subjects and the grades are the UI. It shows your performance clearly.

Home example: A microwave’s keypad and display. You press numbers (UI) and the timer counts down (UI).

Nigerian example: A POS machine. The screen shows prompts like “Enter PIN,” and the buttons let you type. That’s a transaction UI.

Mini Summary: UI is the bridge between the player and the code. Design it to be clear and easy.

Lesson 12: Timers and Waiting – Patience in Code

Definition: A timer block lets you pause the game or wait for a certain number of seconds before the next action.

Why it is important: If a game just blinks everything instantly, it is unplayable. We need delays. “Show this message for 2 seconds, then hide it.” Timers control the speed of the story.

Simple explanation: A traffic light doesn’t snap from green to red. It holds yellow for a few seconds to give drivers time to react. The “wait” block is the yellow light.

Real-life example: A camera timer. You press the button, wait 10 seconds, and flash! The picture is taken.

School example: A countdown for a test. The teacher says, “You have 30 minutes left.”

Home example: Boiling an egg. You wait 5 minutes exactly, then remove it from the fire.

Nigerian example: Suya roasting. The mallam puts meat on fire and waits a specific time before flipping it.

Illustration:

    Sequence:
    [Say "Ready?"]
    [Wait 1 second]
    [Say "Set..."]
    [Wait 1 second]
    [Say "GO!"]
    

Mini Summary: The wait block is the pause button inside a sequence. It makes games breathe.

Lesson 13: Debugging – Fixing the Broken Blocks

Definition: Debugging means finding and fixing errors (bugs) in your block code so the game works as you planned.

Why it is important: Every coder makes mistakes. Even adults with 20 years of experience write bugs. Debugging is not failure; it is the normal, healthy way to build code.

Simple explanation: You build a tall Lego tower. You put a heavy block on top and the whole tower leans. You look closely, find the thin Lego piece that snapped wrong, and fix it. That is debugging.

Real-life example: A bicycle chain falls off. You stop, look at the gears, and put the chain back on correctly. You debugged the bike.

School example: Re-reading your essay and finding a spelling mistake. You erase it and write the correct word.

Home example: Your light bulb does not turn on. You check: is it plugged in? Is the bulb burnt out? You test step by step.

Nigerian example: A generator not starting. The mechanic checks fuel (variable check), spark plug (event check), and oil. He debugs the engine step by step.

Mini Summary: Debugging is detective work. Check your blocks one by one, read the sequence, and find the broken link.

Lesson 14: Sounds and Looks – The Fun Blocks

Definition: These are action blocks that change how a sprite looks (costumes, size, color) or sounds it makes (play sound, change volume).

Why it is important: A silent, stiff game is no fun. Looks and sounds blocks add juice and flavor. They make the player feel rewarded.

Simple explanation: You are acting in a play. Changing your costume (Looks block) shows the audience a new character. Speaking a loud line (Sound block) makes them laugh or gasp.

Real-life example: A firework display. The explosion is a visual look, the boom is the sound.

School example: A school concert. Singers change outfits and the band plays music.

Home example: A birthday party. Balloons are looks, singing “Happy Birthday” is sound.

Nigerian example: Masquerades at a festival. The masquerade changes its movements (animation/looks) and the drummers beat intense rhythms (sound).

Mini Summary: Sprinkle sound blocks and look blocks on your game to make it sparkle and pop.

Lesson 15: Putting It All Together – Your First Game Loop in Blocks

Definition: This is the moment we build the actual game loop from Module Six using blocks. A forever loop that checks input, updates variables, and renders changes.

Why it is important: This proves you understand everything. You are now translating theory into a real, running game.

Simple explanation: We will build a simple “Collect the Balls” game. A bowl follows the mouse (Input). Balls fall from the sky (Update). The score goes up (Render). Let’s wire it up.

Recipe:
1. Event: When Green Flag clicked.
2. Control: Forever Loop.
3. Action: Set Bowl X to Mouse X (follow finger).
4. Control: If Bowl touches Ball.
5. Action: Change Score by 1, move Ball to top, play pop sound.

Real-life example: A goalkeeper game machine in an arcade. You slide a handle (input), the ball shoots (update), and lights flash with the score (render).

School example: A pop quiz game where the teacher shows a question, you buzz in, and the board updates points.

Home example: A baby stacking rings. Input: baby picks a ring. Update: ring slides down pole. Render: pole grows more colorful.

Nigerian example: A digital version of “Whot” cards. You drag a card to the pile. The game checks if the number matches. If it does, your card vanishes and your score updates.

Illustration:

    [When Green Flag Clicked]
        |
        v
    [Forever]
        |
        +---> [Set Bowl X to Mouse X]
        |
        +---> [If touching Ball?]
                    |
                   YES ---> [Change Score by 1]
                              [Go to Ball: Move to Random Top]
                              [Play sound Pop]
    

Mini Summary: You just built a game loop! Input (mouse), Update (collision check), Render (automatic redraw). You are officially a game programmer.

Key Vocabulary

WordSimple Definition
Block CodingProgramming with colorful puzzle pieces.
EventA block that starts something (like a green flag).
ActionA block that does something (move, say, play sound).
ControlA block that controls flow (loop, if, wait).
SequenceThe order of instructions.
LoopRepeating an action many times.
ConditionA yes/no check (if block).
VariableA box that stores a number or word.
CoordinateX and Y position on the screen.
CollisionChecking if sprites are touching.
BroadcastA message sent to all sprites.
CloneA copy of a sprite.
UIUser Interface; buttons and scoreboards.
DebugFinding and fixing errors in code.
TimerA wait block that pauses.

Important Concepts

The Block Trinity: Event, Action, Control. If you can’t find a block, ask yourself: “Am I trying to start something (Event), do something (Action), or manage the flow (Control)?”

Data Flow: Variables store information. Events trigger the reading of that information. Actions change the information. This is how a simple clicker game works.

Readability: Good block code is easy to read by a friend. Snap blocks into small, logical groups. Don’t make a 50-block long snake. It should look neat.

Step-by-Step Explanations: Building a Coin Collector

  1. Step 1: Choose a character sprite (e.g., a lion).
  2. Step 2: Choose an item sprite (e.g., a coin).
  3. Step 3: From Events, drag "When Flag clicked" for the lion.
  4. Step 4: From Control, snap in a "Forever" loop.
  5. Step 5: Inside, from Motion, place "Set X to Mouse X" and "Set Y to Mouse Y".
  6. Step 6: For the coin, create a variable called "Points".
  7. Step 7: In the lion’s forever loop, add an "If touching Coin?" block.
  8. Step 8: Inside the If: "Change Points by 1", "Play sound Collect", "Move Coin to random position".
  9. Step 9: Click the Green Flag and test!
    Flag --> Forever --> Follow Mouse --> If touch Coin --> Score up!
    

Real-life Examples of Block Coding

  • A microwave’s digital panel is block code for heating: Event (Start), Action (Heat), Control (If door open, stop).
  • A vending machine: Event (Coin inserted), Action (Spiral turns), Control (If item in stock).
  • Traffic lights are programmed with loops, waits, and conditions exactly like block code.

Nigerian Examples

  • Ogbonge Engineer: Imagine coding a traffic robot for Ojota. Green light waits 30 seconds, then yellow 5 seconds, then red. That’s a sequence with timers.
  • Jollof Rice Recipe: Writing the steps as blocks: "If Rice is soft, then add tomato stew. Else, wait 5 minutes and check again."
  • Keke Napep: Starting the keke (Event), accelerating (Action in a loop), checking for bumps (Condition).

Fun Examples

  • Dancing Sprite: Use a loop to change costumes 10 times. It looks like a dance!
  • Pet Feeding Game: If you click the pet, it broadcasts "Feed Me" and the food bowl slides over.
  • Ghost Clones: Create a clone of a ghost every 2 seconds. The screen fills with spooky but silly ghosts.

Everyday Examples

  • An elevator button: Event (press floor), Control (if weight OK, close door), Action (move to floor).
  • A TV remote: Event (button press), Action (change channel), Control (if volume down, lower limit).

Teacher Notes

This module is best taught with a projector and a live block coding environment like Scratch or MakeCode. Do not let students memorize blocks. Instead, let them pull blocks apart and see what breaks (debugging). The "Human Block" activity is very effective: write blocks on large papers and have students act out the sequence. Emphasize that getting errors is part of learning. Celebrate every bug found as a step closer to understanding.

Parent Tips

Your child will likely want screen time for "coding." This is creative screen time! Sit with them and ask them to explain their block stack to you. If you don’t understand code, ask, “What happens if you pull this block off?” Their explanation will deepen their learning. Try the offline “recipe” game: give them crazy instructions in the wrong order (Put shoes, then socks) and have them debug you.

Interesting Facts

  • Scratch, the most famous block coding language, was created by a group at MIT for children exactly like you.
  • The color coding of blocks (yellow for Events, blue for Motion) is designed to help your brain quickly sort them.
  • Some professional game developers use visual scripting blocks for very complex games because it makes logic easier to read.
  • Nigerian schools are now participating in the Hour of Code using block tutorials.

Did You Know?

Did you know that the "Forever" loop runs about 30 times per second in Scratch? That means your "if touching" check is running super fast, so it feels instant when you catch a coin!

Did you know that a variable can hold not just numbers, but also names like "Player1"? You can even join two words together using a block that works like glue.

Remember This

  • Code is just giving orders in the right order.
  • If it doesn’t work, check the sequence.
  • Events start, Actions do, Control manages.
  • A variable is a memory box.
  • Debugging is not failing; it is smart fixing.

Common Mistakes

  • Forgetting the Forever loop: Putting an "If key pressed" block without a forever loop. The game checks only once and stops.
  • Wrong variable scope: Creating the "Score" variable for one sprite only and wondering why another sprite can’t change it. Make it "For all sprites."
  • Sequence slip: Telling the sprite to hide before moving. The player might see it vanish in the wrong spot.
  • Broadcast echo: A broadcast that triggers another broadcast in a never-ending loop, crashing the game.

Best Practices

  • Test one block at a time. Don’t snap 20 blocks, then test. Snap 2, test. Snap 2 more, test.
  • Name your variables clearly. “Score” is good. “Variable1” is confusing.
  • Clean up your code space. If a sprite is not used, delete it. A clean screen helps you think.
  • Use comments. Right-click a block and add a comment explaining what it does.

More Visual Aids

Flowchart: Decision in a Game

    Player presses "Space"
           |
           v
    Is Energy > 0?
        /      \
      YES        NO
      /            \
    Jump!        Say "Tired!"
      |
      v
    Subtract Energy
    

Timeline: Learning Block Coding

    Hour 1: Learn to drag and snap
    Hour 2: Move the cat with keyboard
    Hour 3: Catch a star using collision
    Hour 4: Add a score variable
    Hour 5: Build the whole Game Loop!
    

Table: Block Types and Colors (Typical)

Block ShapeColor FamilyJob
Hat Block (curved top)Yellow/GoldEvents
RectangleBlueMotion
RectanglePurpleLooks
RectanglePink/MagentaSound
"C" ShapeOrangeControl (Loop/If)
Rounded EndsGreenOperators (Math)
RectangleRed/OrangeVariables

Comparison: Text Code vs Block Code

FeatureText Code (Python / Lua)Block Code (Scratch)
Typing skill neededHigh (exact spelling)Low (drag and drop)
Memory neededMust memorize commandsCommands are visible in menus
Error riskOne dot breaks everythingBlocks don’t snap if wrong
FlexibilityVery high (can do anything)High, but limited to available blocks
Best for beginners?Absolutely notAbsolutely yes!

End-of-Module Summary

Fantastic job, coder! You have completed Module Seven. You have made the big jump from paper planning to digital building. Let’s remember this journey:

  • You became Amara, telling a robot exactly what to do.
  • You learned that block coding uses colorful puzzle pieces: Events (the starters), Actions (the doers), and Control (the managers).
  • You built Sequences and realized that putting socks on after shoes is a bug!
  • You harnessed the power of Loops to repeat without boredom, and Conditions to make smart choices.
  • You stored precious memories in Variables and moved sprites with Coordinates.
  • You made things collide, broadcast messages, and cloned an army of sprites.
  • Finally, you built a beautiful UI, debugged like a detective, and wove it all into a real Game Loop.

You are no longer just a player. You are a builder. You talk to machines. That is a superpower. Use it wisely and keep creating!

Frequently Asked Questions (FAQs)

  1. Q: Do I need to install anything?
    A: Most block coding tools like Scratch work on a web browser. No installation is needed!
  2. Q: Can I make a 3D game with blocks?
    A: Usually, block coding is for 2D games. 3D needs heavier tools, but the logic you learned here is exactly the same.
  3. Q: My block won’t snap. Why?
    A: The shapes must match. A round hole needs a round peg. Check if you’re trying to put a check block into a number slot.
  4. Q: What is a sprite costume?
    A: A costume is just another picture for the same sprite. Switching costumes is what makes animation.
  5. Q: Can I share my block game with friends?
    A: Yes! Most platforms have a “Share” button that gives you a link to send to friends.
  6. Q: Why does my clone look wrong?
    A: Did you hide the original sprite and only show the clones? The original might be sitting on top!
  7. Q: How do I stop a forever loop?
    A: Use a “Stop All” block inside a condition, like “If Score = 10, Stop All.”
  8. Q: Is block coding real coding?
    A: Yes! Real logic, real rules, real results. The only difference is you use a mouse instead of a keyboard.
  9. Q: Can I make a career out of this?
    A: Many professional game designers started with block coding. It teaches the brain to think logically.
  10. Q: My game is slow. What happened?
    A: You might have too many clones or a forever loop that creates things non-stop. Add a “wait” or limit the clones.

Review Questions (15 Questions)

  1. What are the three main families of blocks?
  2. Explain why a sequence matters in code.
  3. What block do you use to make something repeat 20 times?
  4. What keyword starts a yes/no question block?
  5. If you want to store a player’s name, what do you create?
  6. Which block type is used for “When Green Flag Clicked”?
  7. How does a sprite move to the right?
  8. What is the “touching” block used for?
  9. If you want all sprites to know the game is over, what block do you use?
  10. What is a copy of a sprite called?
  11. Why do we use a “Wait” block?
  12. What is the screen display for a score called?
  13. What do we call fixing an error in code?
  14. What is the magical loop that makes a game run forever?
  15. Describe a “Forever” loop in words.

Fill-in-the-Blank Exercises

1. The three block families are Event, Action, and ________.

2. A ________ is a box that stores a number or word.

3. A repeating block is called a ________.

4. The “If” block asks a Yes or No ________.

5. To copy a sprite, we make a ________.

6. X is the horizontal ________.

7. The ________ block sends a message to all sprites.

8. We find bugs by ________.

9. The block that pauses the code is the ________ block.

10. The ________ button usually starts the game.

True or False Exercises

1. Blocks can snap in any order without problems. False

2. A variable can only hold numbers. False (It can hold words too)

3. The “Forever” loop runs only once. False

4. The “If” block is a Control block. True

5. Debugging means making the game harder. False

6. A broadcast is a secret whisper between two sprites only. False (Everyone hears it)

7. Sequence is the order of instructions. True

8. UI stands for Under Instruction. False (User Interface)

9. Clones are perfect copies that can do things independently. True

10. The "touching" block is used for collision detection. True

Multiple Choice Questions (15 Questions)

  1. What is block coding?
    a) Typing long commands
    b) Dragging and snapping puzzle pieces
    c) Drawing pictures only
    Answer: b
  2. Which block family does “When Green Flag Clicked” belong to?
    a) Action
    b) Control
    c) Event
    Answer: c
  3. A loop is used for:
    a) Changing color
    b) Repeating actions
    c) Stopping sounds
    Answer: b
  4. What does a variable do?
    a) Changes the volume
    b) Stores data
    c) Closes the game
    Answer: b
  5. The question part in an “If” block is called a:
    a) Guess
    b) Condition
    c) Event
    Answer: b
  6. To move a sprite right, you change its:
    a) Y coordinate
    b) Sound pitch
    c) X coordinate
    Answer: c
  7. What does “broadcast” do?
    a) Sends a message to one specific sprite
    b) Sends a message to all sprites
    c) Turns on the microphone
    Answer: b
  8. A clone is:
    a) A new name
    b) A perfect copy
    c) A type of bug
    Answer: b
  9. UI means:
    a) Unreal Inventory
    b) User Interface
    c) Ultra Input
    Answer: b
  10. Debugging is:
    a) Removing insects
    b) Finding and fixing errors
    c) Deleting the game
    Answer: b
  11. Which block pauses the game?
    a) Forever
    b) Wait
    c) Repeat
    Answer: b
  12. The Game Loop is usually wrapped in what block?
    a) One-time event
    b) Forever loop
    c) Broadcast
    Answer: b
  13. If you forget the Forever loop, your game will:
    a) Run too fast
    b) Run only once
    c) Explode
    Answer: b
  14. To check a collision, you use:
    a) The wait block
    b) The touching block
    c) The hide block
    Answer: b
  15. The best way to test your block code is:
    a) Snap all blocks at once and hope
    b) Snap a few blocks, test, then add more
    c) Never test, just share it
    Answer: b

Matching Exercises

Match the word to its meaning:

WordMatchMeaning
1. VariableAA puzzle piece that tells the computer what to do
2. BlockBA storage box for numbers or text
3. ConditionCA copy of a sprite
4. CloneDA yes/no check
5. SequenceEThe exact order of steps

Answers: 1-B, 2-A, 3-D, 4-C, 5-E

Short Answer Questions

  1. Describe the difference between an Event block and an Action block.
  2. Explain what happens if you place a "Move 10 steps" block outside of a loop versus inside a loop.
  3. Why is the "Forever" block the perfect home for a game loop?
  4. Write a step-by-step plan (a pseudo-code block recipe) for a space shooter game where a rocket catches stars.
  5. How does broadcasting help the different parts of a game work together?

Scenario-based Exercises

  1. Scenario: Your character moves left when you press the right arrow. What is the bug? (Answer: You likely put "Change X by -10" for the right arrow, or you mixed up the left and right keys.)
  2. Scenario: You have a coin clone that just sits there and doesn’t disappear when touched. List two things you should check. (Answer: Is there a "touching" block in the clone’s code? Does the clone run its own script? Is the collision check inside a loop?)

Group Activity: The Human Block Relay

Goal: Act out a block sequence.

  1. Print large cutouts of block shapes: Event (Hat), Action (Move, Say), Control (Repeat).
  2. Form a line of five students.
  3. The teacher holds an "Event" block and says "Go!"
  4. Student 1 runs to the board (Action: Move).
  5. Student 2 draws a circle (Action: Draw).
  6. Student 3 checks if the circle is red (Control: If).
  7. Student 4 shouts "It’s blue!" (Action: Say).
  8. Student 5 holds a "Repeat 2 times" sign and sends the first student back to run again!
  9. Discuss how the flow felt.

Individual Activity: Debugging the Backwards Code

You will receive a broken block sequence from your teacher (e.g., Say Goodbye, Wait, Say Hello, Move). Rewrite it in the correct order so the character walks forward, says "Hi!", waits, and then says "Bye!".

Classroom Discussion Questions

  • If you could invent any new block to do anything you want, what would it do and what color would it be?
  • Which is harder: being the game designer (planning) or the game programmer (coding the blocks)? Why?
  • Why do you think computers are so strict about the sequence?
  • How can block coding help you in subjects other than computer class?

Mini Project: The Talking Machine

Build a block project without any motion. Use only Events, Looks, and Sound. Create a character that tells a joke when you press the spacebar, looks surprised when you press "S", and loops a funny dance when you click the flag. Focus purely on sequencing and broadcasting.

Practical Assignment: My First Digital GDD

Take your Game Design Document (GDD) from Module Six. Inside a block coding app, place the first 5 blocks that start the game. For example: “When Green Flag clicked”, “Set Score to 0”, “Show Title Screen”, “Wait 2 seconds”, “Broadcast Start Game”. Do not build the whole game, just the exact start.

Challenge Exercise: The Password Gate

Create a gate sprite that asks for a password using a question block. The player types the answer. If the password is “Jollof”, the gate opens (hides) and broadcasts “Access Granted”. If the password is wrong, the gate shakes and says “Try Again”. Use variables to track attempts and lock out after 3 failed tries.

Quiz Answers (Quick Reference)

Fill-in-the-Blanks: 1.Control, 2.Variable, 3.Loop, 4.Condition, 5.Clone, 6.Coordinate, 7.Broadcast, 8.Debugging, 9.Wait, 10.Flag.

True/False: 1.F, 2.F, 3.F, 4.T, 5.F, 6.F, 7.T, 8.F, 9.T, 10.T.

MCQ Answers: See the answer key under each question (all B options).

Key Takeaways

  • Block coding is logical play. You think, you snap, you test.
  • Events, Actions, Control. Master these three and you master all games.
  • Bugs are clues. Every broken block teaches you something new.
  • You control the machine. The computer is fast, but it only does what you say.
  • Start small, dream big. A clicker game today can be an adventure game tomorrow.

Preparation for the Next Module: Module Eight – Building Your First Complete Game

You have done it! You wrote code with blocks and built a simple game loop. In Module Eight, we will take everything from Modules Six and Seven and combine them into one full project.

We will build a multi-level adventure game. You will design the art, code the controls, manage the score across different screens, and add a boss fight.

To prepare for Module Eight, please do this:

  • Look at your favorite simple mobile game. Can you guess what the blocks for the main character would look like?
  • Draw a flowchart on paper for a two-level game: a forest level and a castle level. How does the player move from forest to castle? (Hint: It’s a broadcast!)
  • Practice using the "Ask" block and the "Answer" variable. We will use player input more in the next module.

Get ready to become a full game architect. You have the tools, you have the talent. Let’s build an epic game! See you in Module Eight.


End of Module Seven. High five, brilliant coder!

🏆 Get Certified

🔒

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (₦2,000 or 20,000 coins), and get a verified certificate with your name on it.

🎓 Sign Up to Get Certified
🛠️ Practice Tools
Hands-on simulators & labs - subscription required.
→
🎯 Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
→