← Certified Scratch Expert Level Two Β· Lesson 9 of 11

Module Eight

πŸ“– 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.
1

Coure Outline

Certified Scratch Expert Level 2 – Course Outline

Certified Scratch Expert Level 2

Advanced Coding & Game Dev
Duration30–40 hours
AudienceAges 8–17, Level 1 grads
FormatLive / self-paced
CertificationLevel 2 Expert

Learning Objectives

  • Design and build multiple complete games with structured approaches
  • Implement game states (start, play, win, game over) to control flow
  • Create enemy behaviors and simple AI systems
  • Use lists to manage data such as cards, objects, and game elements
  • Build spawning systems and control object creation using timing
  • Structure code using custom blocks (My Blocks) and reusable systems
  • Use Scratch extensions like pen, music, and video sensing
  • Debug, test, and improve multi-system games effectively
  • Combine multiple programming concepts into complete game experiences
  • Apply principles of good game design to create games with multiple levels
1

Review and Foundations

Solidifying core concepts and introducing structured thinking

  • Review motion, looks, sound, events
  • Review loops, conditions, and variables
  • Review broadcasting and basic game design
  • Introduction to structured programming
  • Understanding game states (start, play, win, game over)
  • The "My Blocks" (custom blocks) category
2

Lists – Advanced Data Management

Managing collections of data with lists

  • What is a list and why use it?
  • Creating and using lists
  • Adding, removing, and changing items
  • Searching lists for specific values
  • Using lists for high scores, inventory, cards
  • Lists vs. multiple variables – when to use each
3

Custom Blocks – Reusable Code

Creating your own blocks for cleaner, organized code

  • What are custom blocks and why use them
  • Creating a custom block (My Blocks)
  • Adding inputs (parameters) to custom blocks
  • Simplifying complex scripts with custom blocks
  • Creating reusable systems
4

Game States and Structured Flow

Controlling game flow using states

  • Understanding game states: start, play, win, game over
  • Using variables to track game state
  • Creating start screens and instructions
  • Implementing win and game over screens
  • Managing transitions between states
  • Structured game flow design
5

Enemy Behaviors and Simple AI

Introducing artificial intelligence for enemies

  • What is AI in games?
  • Creating enemy movement patterns
  • Implementing chase and patrol behaviors
  • Using sensing blocks for enemy awareness
  • Making enemies react to the player
  • Simple AI state machines
6

Spawning Systems and Object Management

Creating and managing multiple objects dynamically

  • Spawning objects using cloning
  • Controlling spawn timing and rates
  • Random spawning systems
  • Managing object lifetimes and deletion
  • Object pooling concepts
7

Physics and Motion Systems

Introducing physics for realistic mechanics

  • Gravity simulation
  • Velocity and acceleration concepts
  • Collision detection and response
  • Arc trajectories for projectiles
  • Bounce physics
8

Scratch Extensions

Exploring powerful Scratch extensions

  • Pen extension – drawing and graphics
  • Music extension – creating melodies and beats
  • Video sensing – motion detection and camera interaction
  • Text-to-speech extension
  • Micro:bit and LEGO extensions (if available)
9

Game Design and Polish

Making games feel complete and professional

  • Principles of good game design
  • Adding sound effects and background music
  • Visual feedback and polish
  • Difficulty progression and balancing
  • User interface design (score, health bars)
  • Playtesting and getting feedback
10

Capstone Project – Complete Game

Building a complete, original game from start to finish

  • Project planning and game design document
  • Game states (start, play, win, game over)
  • Lists for data management
  • Custom blocks for reusable code
  • Enemy behaviors and AI
  • Spawning systems
  • Scoring, lives, and progression
  • Polish and user interface
  • Debugging and testing
  • Project showcase

Delivery

  • Live online sessions (24Γ—50 min)
  • 1-on-1 or small group instruction
  • Hands-on projects and exercises
  • Final project development

Assessment

  • Project-based module assessments
  • Progress checkpoints
  • Final capstone project evaluation
  • Certificate of completion

Duration

  • 3–6 months
  • Flexible pacing
  • Prerequisite: Level 1 or equivalent

Aligned with Standards

  • CSTA (Computer Science Teachers Association)
  • ISTE Education Standards
  • STEM.org Accreditation

Recommended Resources

  • Scratch Foundation Learning Library
  • "Scratch Game Development From Zero To Proficiency"
  • "The Teacher's Guide to Scratch – Intermediate"
  • "Scratch Programming for Kids: Advanced Guide"
Certified Scratch Expert Level 2 – Complete Course Outline v1.0 Β· 2026
2

Module One

Module 1: Review and Foundations – Level 2

πŸ“˜ Module 1: Review and Foundations – Level 2

β€œBuilding on what you know to create something amazing.”

🌟 Module Introduction

Welcome to Level 2 of the Certified Scratch Expert course!

In Level 1, you learned the basics – how to make sprites move, change, speak, and interact. You created animations, stories, and simple games. You learned about loops, conditions, and variables.

Now it's time to go further. In Level 2, we will explore advanced topics like lists, custom blocks, game states, enemy AI, and Scratch extensions. But before we dive into new things, let's review what you already know.

Think of this module as your "warm-up" before the big race. We will revisit the key concepts from Level 1 and make sure you are ready for the advanced challenges ahead.

🎯 Learning Objectives

  • Recall and use motion, looks, sound, and events blocks.
  • Explain and use loops, conditions, and variables.
  • Understand broadcasting and its use in games.
  • Explain the concept of game states (start, play, win, game over).
  • Understand what custom blocks are and why they are useful.
  • Think in terms of "structured programming" – organizing code for reuse.

πŸ“– Warm-up Story: The Young Game Maker Returns

Imagine you are Chidi, a young coder in Lagos. You completed Level 1 and created some cool games. Now you are ready for Level 2.

You open Scratch and see the familiar interface. You remember how to make sprites move, how to use loops, and how to create variables. You feel confident.

Your teacher gives you a challenge: "Create a game with multiple levels, enemies that chase the player, and a high score system."

You know you can do it because you have a strong foundation. You review what you learned and get ready to build something amazing.

πŸ“š Main Lessons

Lesson 1: Motion and Looks – Moving and Changing

Definition: Motion blocks move sprites. Looks blocks change their appearance.

Why important: These are the most basic building blocks of any Scratch project.

Simple explanation: Motion is like walking; looks is like changing your outfit.

Real-life example: A dancer moves (motion) and changes costumes (looks).

School example: A student walks to the front of the class and changes their posture.

Home example: A person moves around the house and changes clothes.

Nigerian example: A dancer performs a traditional dance with different steps and changes costumes.

    Motion and Looks:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Motion: move 10 steps, turn, glide        β”‚
    β”‚  Looks: say, think, switch costume, size   β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Motion moves sprites; looks change their appearance.

Lesson 2: Sound and Events – Hearing and Triggering

Definition: Sound blocks add audio. Events blocks start your code.

Why important: Sound makes projects engaging. Events make them interactive.

Simple explanation: Sound is like music; events are like a starting signal.

Real-life example: A doorbell (event) triggers a sound (sound).

School example: A bell rings (event) and students go to class (action).

Home example: An alarm clock rings (event) and you wake up.

Nigerian example: A market vendor shouts (sound) to attract customers (event).

    Sound and Events:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Sound: start sound, play sound until done  β”‚
    β”‚  Events: when green flag clicked, key pressedβ”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Sound adds audio; events start code.

Lesson 3: Loops – Repeating Actions

Definition: Loops repeat blocks of code.

Why important: Loops save you from writing the same code many times.

Simple explanation: It's like a dancer who keeps dancing without stopping.

Real-life example: A washing machine repeats the same cycle.

School example: A teacher repeats the same lesson for different classes.

Home example: You eat breakfast every day – that's a loop!

Nigerian example: A drummer repeats a rhythm.

    Loops:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  forever – repeats forever                  β”‚
    β”‚  repeat 10 – repeats 10 times              β”‚
    β”‚  repeat until – repeats until condition    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Loops repeat actions.

Lesson 4: Conditions – Making Decisions

Definition: Conditions make decisions – "if this happens, do that".

Why important: Conditions make your code smart and responsive.

Simple explanation: It's like a traffic light – if red, stop; if green, go.

Real-life example: If it rains, take an umbrella.

School example: If you finish your work, you can play.

Home example: If the food is ready, eat; otherwise, wait.

Nigerian example: If the market is crowded, go later.

    Conditions:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  if – runs code if true                     β”‚
    β”‚  if-else – runs one code if true, another   β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Conditions make decisions.

Lesson 5: Variables – Storing Data

Definition: Variables store values – like scores, names, or lives.

Why important: Variables remember things so you can use them later.

Simple explanation: It's like a box where you put something and take it out later.

Real-life example: A savings account stores money.

School example: A grade book stores student scores.

Home example: A shopping list stores items you need to buy.

Nigerian example: A market woman remembers her prices (variables).

    Variables:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  set score to 0 – sets the value           β”‚
    β”‚  change score by 1 – changes the value     β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Variables store data.

Lesson 6: Broadcasting – Sending Messages

Definition: Broadcasting sends messages between sprites.

Why important: It allows sprites to communicate and coordinate.

Simple explanation: It's like a walkie-talkie – one sprite says something, and others hear it.

Real-life example: A teacher announces a fire drill – everyone hears it.

School example: A student tells the class a message.

Home example: A parent says "Dinner is ready!"

Nigerian example: A town crier announces news.

    Broadcasting:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  broadcast "win" – sends the message       β”‚
    β”‚  when I receive "win" – responds           β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Broadcasting sends messages between sprites.

Lesson 7: Game States – Controlling Game Flow

Definition: Game states are the different phases of a game – start, play, win, game over.

Why important: Game states organize the flow of your game.

Simple explanation: It's like the chapters of a book – each chapter is a state.

Real-life example: A sports match has states – before, during, after.

School example: A lesson has states – introduction, teaching, practice.

Home example: A meal has states – preparing, eating, cleaning.

Nigerian example: A wedding has states – ceremony, reception, after-party.

    Game States:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Start β†’ Play β†’ Win / Game Over            β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Game states control the flow of your game.

Lesson 8: Custom Blocks (My Blocks) – Reusable Code

Definition: Custom blocks are blocks you create yourself.

Why important: They let you reuse code and keep your project organized.

Simple explanation: It's like creating your own tool – you can use it again and again.

Real-life example: A recipe – you can use it to cook the same dish many times.

School example: A formula in math – you can use it for different problems.

Home example: A cleaning checklist – you can use it every week.

Nigerian example: A traditional recipe passed down in a family.

    Custom Blocks:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Define jump – your own block              β”‚
    β”‚  Use it like any other block               β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Custom blocks let you reuse code.

Lesson 9: Structured Programming – Organizing Code

Definition: Structured programming means organizing your code in a clear, logical way.

Why important: Organized code is easier to understand and fix.

Simple explanation: It's like organizing a bookshelf – books are easier to find.

Real-life example: A well-organized kitchen – you know where everything is.

School example: A well-organized notebook – you can find notes easily.

Home example: A tidy room – you can find things quickly.

Nigerian example: A market where goods are organized by type.

    Structured Programming:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Use custom blocks for repeated actions    β”‚
    β”‚  Keep code clean and organized             β”‚
    β”‚  Use comments to explain your code         β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Structured programming keeps code organized.

Lesson 10: Putting It All Together – A Simple Game

Why important: Reviewing by building helps you remember.

Steps:

  1. Create a simple game – a character that moves with arrow keys.
  2. Add a score variable.
  3. Add a condition – if the character touches a target, score increases.
  4. Add a broadcast – when score reaches 5, say "You Win!".

Nigerian example: A game where you collect Nigerian flags.

βœ… Mini summary: Build a simple game to review all concepts.

πŸ“Œ Key Vocabulary

Motion – Movement blocks.
Looks – Appearance blocks.
Events – Triggers for code.
Loop – Repeats actions.
Condition – Makes a decision.
Variable – Stores data.
Broadcast – Sends a message.
Game state – Phase of a game.
Custom block – Your own block.
Structured programming – Organized code.

🧠 Important Concepts

  • Foundation: Strong basics make advanced coding easier.
  • Organization: Clean code is easier to debug.
  • Reuse: Custom blocks save time.

πŸ”’ Steps to Perform Key Tasks

Task 1: Review Motion and Looks

  1. Open Scratch.
  2. Add a sprite.
  3. Add "when green flag clicked".
  4. Add "move 10 steps".
  5. Add "say Hello".
  6. Click the green flag.

Task 2: Review Variables and Conditions

  1. Create a variable called "score".
  2. Add "when green flag clicked" – set score to 0.
  3. Add "if score = 5" – say "You Win!".
  4. Test it.

Task 3: Review Broadcasting

  1. Broadcast a message called "win".
  2. Add "when I receive win" – say "Victory!".
βœ… Mini summary: Follow these steps to review key concepts.

πŸ”’ Step-by-step: Review Game

  1. Open Scratch – start a new project.
  2. Add a sprite – choose a character.
  3. Add a backdrop – choose a background.
  4. Add "when green flag clicked" – set score to 0.
  5. Add arrow key controls – move the sprite.
  6. Add a target sprite – create a collectible.
  7. Add "if touching target" – increase score and move target.
  8. Add condition – if score = 5, broadcast "win".
  9. Receive "win" – say "You Win!".
  10. Test your game.

🧸 Fun Examples for Children

  • Pet game: Move a pet and give it treats to score.
  • Space game: Collect stars in space.

🏠 Everyday Examples

  • Family game: Create a simple game for family night.
  • School quiz: Review quiz game.

πŸ‘ͺ Parent Tips

  • Help your child review by asking them to explain concepts.
  • Encourage them to build a simple game to test their knowledge.
  • Celebrate their progress – they are ready for Level 2!

πŸ’‘ Interesting Facts

  • Professional developers constantly review fundamentals.
  • Reviewing helps you remember and understand better.
  • Scratch was designed to make coding accessible to everyone.

❓ Did You Know?

  • Scratch was created in 2003.
  • It has been translated into over 70 languages.

πŸ”” Remember This

  • Motion moves sprites.
  • Looks change appearance.
  • Events start code.
  • Loops repeat actions.
  • Conditions make decisions.
  • Variables store data.
  • Broadcasting sends messages.
  • Game states control flow.
  • Custom blocks reuse code.
  • Structured programming keeps code organized.

⚠️ Common Mistakes

  • "I forgot to use an event block." – Always start with an event.
  • "My variables aren't updating." – Make sure you change them.
  • "My broadcast doesn't work." – Check the message names.
  • "My code is messy." – Organize with custom blocks.

βœ… Best Practices

  • Always start with an event block.
  • Test your code after each change.
  • Use clear variable names.
  • Use custom blocks for repeated code.
  • Keep your code organized.
  • Save your project often.

πŸ“Š Comparison: Level 1 vs Level 2 Focus

ConceptLevel 1Level 2
VariablesBasic use (score, lives)Lists and advanced data
BlocksBuilt-in blocksCustom blocks (My Blocks)
Game flowSimple start/stopGame states (start, play, win)
AISimple reactionsEnemy behaviors and AI
ExtensionsNot usedPen, music, video sensing

πŸ“ End-of-Module Summary

Great job! You have reviewed the fundamentals:

  • Motion and Looks: Move and change appearance.
  • Sound and Events: Add audio and trigger actions.
  • Loops: Repeat actions.
  • Conditions: Make decisions.
  • Variables: Store data.
  • Broadcasting: Send messages.
  • Game States: Control flow.
  • Custom Blocks: Reuse code.

You are now ready for the advanced topics in Level 2!

❓ Frequently Asked Questions

  • Q1: Why do I need to review?
    Reviewing strengthens your foundation for advanced topics.
  • Q2: What is a custom block?
    A block you create yourself to reuse code.
  • Q3: What is a game state?
    A phase of your game – start, play, win, game over.
  • Q4: What is broadcasting?
    Sending messages between sprites.
  • Q5: Why is structured programming important?
    It keeps your code organized and easy to fix.
  • Q6: What is a variable?
    A container that stores data.
  • Q7: What is a loop?
    Repeats actions.
  • Q8: What is a condition?
    Makes a decision.
  • Q9: What is an event?
    Triggers code.
  • Q10: What's next after this module?
    Lists, custom blocks, game states, AI, and extensions!

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. MotionA. Repeats actions
2. LoopB. Moves sprites
3. VariableC. Stores data
4. ConditionD. Makes a decision

(Answers: 1-B, 2-A, 3-C, 4-D)

🎭 Scenario-based Exercise

Scenario: A student wants to create a game where a character moves and collects stars. They want to add a score and a win condition.

Question: What concepts from Level 1 would they use? List the blocks.

πŸ‘₯ Group Activity

In groups of 4, each person explains one Level 1 concept to the group. Discuss how you have used it before.

✍️ Individual Activity

Build a simple game that uses motion, looks, events, loops, conditions, variables, and broadcasting. Save your project.

πŸ› οΈ Mini Project

Create a game where a character collects 5 items. Use a variable for score, a condition for winning, and broadcasting for the win message.

πŸ“‹ Practical Assignment

Write a short reflection on what you reviewed and how you have used these concepts before. Include examples.

πŸ”‘ Key Takeaways

  • Reviewing strengthens your foundation.
  • Motion, looks, events, loops, conditions, and variables are the basics.
  • Broadcasting enables communication between sprites.
  • Game states control flow.
  • Custom blocks reuse code.
  • You are ready for Level 2!

πŸ’¬ Classroom Discussion Questions

  • What is the most important concept you learned in Level 1?
  • How do you use loops and conditions together?
  • Why is organization important in coding?
  • What are you most excited to learn in Level 2?

πŸ”œ Preparation for Module 2

In Module 2, we will explore Lists – Advanced Data Management. You will learn how to store and manage collections of data like high scores, inventories, and card decks.

Think about a game that uses a list – like a card game or a shopping list. We will learn how to build these in Scratch!


You have completed Module 1 – you are ready for Level 2! πŸŽ‰

3

Module Two

Module 2: Lists – Advanced Data Management

πŸ“˜ Module 2: Lists – Advanced Data Management

β€œManaging collections of data like a pro.”

🌟 Module Introduction

In Module 1, we reviewed the basics of Scratch – motion, looks, events, loops, conditions, and variables. Now it's time to learn something new and powerful: lists.

Think of a variable as a single box that holds one thing – like a score or a name. A list is like a shelf with many boxes, each holding a different item. You can store many things in a list – high scores, inventory items, card decks, and more.

Lists are one of the most important tools in programming. They let you manage collections of data easily.

In this module, we will learn what lists are, how to create them, and how to use them in your games and projects. Let's get started!

🎯 Learning Objectives

  • Define what a list is and why it is useful.
  • Create and use lists in Scratch.
  • Add, remove, and change items in a list.
  • Search a list for specific values.
  • Use lists to manage game data (high scores, inventory, cards).
  • Understand when to use lists vs multiple variables.

πŸ“– Warm-up Story: The Shopping List

Imagine you are going to the market in Lagos. Your mother gives you a shopping list: rice, beans, tomatoes, onions, and pepper. You take the list and buy each item one by one.

That list is like a Scratch list! It holds many items, and you can add, remove, or change them. If you forget to buy something, you can add it later.

In this module, we will learn how to create lists in Scratch – just like your shopping list, but for games!

πŸ“š Main Lessons

Lesson 1: What is a List?

Definition: A list is a collection of items stored together.

Why important: Lists let you manage many pieces of data easily.

Simple explanation: A variable is one box; a list is a shelf with many boxes.

Real-life example: A shopping list – you can add, remove, and check items.

School example: A class list – all the students' names.

Home example: A to-do list – tasks you need to complete.

Nigerian example: A market vendor's inventory – items they have in stock.

    List vs Variable:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Variable: score = 5                       β”‚
    β”‚  List: [rice, beans, tomatoes, onions]     β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: A list is a collection of items.

Lesson 2: Creating a List in Scratch

Why important: You need to create a list before you can use it.

How to create:

  • Click the "Variables" category.
  • Click "Make a List".
  • Give your list a name (e.g., "shoppingList").
  • Choose "For all sprites" or "For this sprite only".
  • Click "OK".

Nigerian example: A student creates a list called "gameScores".

βœ… Mini summary: Click "Make a List" to create one.

Lesson 3: Adding Items to a List

Why important: You need to add items to your list.

How to add:

  • Use the "add item to list" block.
  • Specify what to add (e.g., "rice").
  • You can also type items directly in the list view.

Nigerian example: A game adds the player's score to a high scores list.

βœ… Mini summary: Add items to your list using the "add" block.

Lesson 4: Removing Items from a List

Why important: You may need to remove items – like when an item is used.

How to remove:

  • Use "delete 1 of list" to remove an item by position.
  • Use "delete all of list" to clear the list.

Nigerian example: A card game removes a card from the player's hand when played.

βœ… Mini summary: Remove items using "delete".

Lesson 5: Changing Items in a List

Why important: Sometimes you need to update an item.

How to change:

  • Use "replace item 1 of list with" to change a specific item.
  • You can also edit directly in the list view.

Nigerian example: A game updates the player's score in a high scores list.

βœ… Mini summary: Use "replace" to change items.

Lesson 6: Getting Items from a List

Why important: You need to read items from your list.

How to get:

  • Use "item 1 of list" to get a specific item.
  • Use "length of list" to find out how many items are in the list.
  • Use "list contains" to check if an item is in the list.

Nigerian example: A game checks if a player's name is in the high scores list.

βœ… Mini summary: Get items using "item", "length", and "contains".

Lesson 7: Searching a List

Definition: Searching means checking if an item is in the list.

Why important: You might want to see if a player's name is already in a list.

How to search:

  • Use "list contains item" block.
  • Loop through the list to find items.

Nigerian example: A game checks if a player's name is already in the high scores list.

βœ… Mini summary: Use "contains" to search a list.

Lesson 8: Looping Through a List

Definition: Looping through a list means checking every item one by one.

Why important: You can process all items in a list.

How to loop:

  • Use a "repeat" or "repeat until" loop.
  • Use a counter variable to track positions.
  • Use "item counter of list" to get each item.

Nigerian example: A game displays all high scores in a list.

βœ… Mini summary: Loops let you process all items in a list.

Lesson 9: Lists vs Multiple Variables

Why important: Knowing when to use lists vs variables saves time.

ListsMultiple Variables
Many itemsFew items
Dynamic (can grow/shrink)Fixed
Easy to loop throughHard to loop through
Example: high scoresExample: score, lives

Nigerian example: A game uses a list for high scores and variables for score and lives.

βœ… Mini summary: Lists are for many items; variables are for single values.

Lesson 10: Using Lists for High Scores

Why important: High scores are a common use for lists.

Steps:

  1. Create a list called "highScores".
  2. When a game ends, add the player's score to the list.
  3. Sort the list (if needed).
  4. Display the top scores.

Nigerian example: A game shows the top 5 scores on a leaderboard.

βœ… Mini summary: Lists are perfect for high scores.

Lesson 11: Using Lists for Inventory

Why important: Games often have inventories.

Steps:

  1. Create a list called "inventory".
  2. When a player collects an item, add it to the list.
  3. When a player uses an item, remove it.
  4. Display the inventory on screen.

Nigerian example: A game where a player collects different fruits.

βœ… Mini summary: Lists are great for inventories.

Lesson 12: Using Lists for Card Games

Why important: Card games need decks and hands.

Steps:

  1. Create a list called "deck" with all cards.
  2. Shuffle the deck.
  3. Deal cards to a "hand" list.
  4. Play cards by removing them.

Nigerian example: A simple card game like "Whot" or "Poker".

βœ… Mini summary: Lists are essential for card games.

πŸ“Œ Key Vocabulary

List – A collection of items.
Item – A single element in a list.
Add – Insert an item.
Remove – Delete an item.
Replace – Change an item.
Length – Number of items.
Search – Find an item.
Loop – Process all items.
Inventory – Items a player has.
High score – Top scores.

🧠 Important Concepts

  • Collections: Lists store collections of data.
  • Dynamic: Lists can grow and shrink.
  • Efficiency: Lists make managing data easier.

πŸ”’ Steps to Perform Key Tasks

Task 1: Create a List

  1. Click Variables.
  2. Click "Make a List".
  3. Name it "myList".
  4. Click "OK".

Task 2: Add Items to a List

  1. Use "add item to list".
  2. Add "apple", "banana", "orange".
  3. See your list grow.

Task 3: Remove an Item

  1. Use "delete 1 of list".
  2. Remove "apple".
  3. Check your list.

Task 4: Get the Length of a List

  1. Use "length of list".
  2. Show it in a say block.
βœ… Mini summary: Follow these steps to use lists.

πŸ”’ Step-by-step: Creating a High Scores List

  1. Create a list – call it "highScores".
  2. Add a "when green flag clicked" – clear the list.
  3. Add a "when game ends" – add the score to the list.
  4. Add a "say" block – show the top scores.

🧸 Fun Examples for Children

  • Pet list: Create a list of pets you want to adopt.
  • Game items: Create a list of items in a game.

🏠 Everyday Examples

  • Shopping list: Items to buy.
  • To-do list: Tasks to complete.

πŸ‘ͺ Parent Tips

  • Show your child how lists are like shopping lists.
  • Encourage them to create lists for their projects.
  • Help them understand the difference between variables and lists.

πŸ’‘ Interesting Facts

  • Lists are used in almost every programming language.
  • Lists are also called "arrays" in other languages.
  • Scratch lists are very powerful and easy to use.

❓ Did You Know?

  • You can add any type of item to a list – numbers, text, even pictures.
  • You can have lists inside lists!

πŸ”” Remember This

  • A list is a collection of items.
  • Create a list using "Make a List".
  • Add, remove, and change items.
  • Use loops to process all items.
  • Lists are great for high scores, inventory, and cards.

⚠️ Common Mistakes

  • Forgetting to create a list. – Always create your list first.
  • Using the wrong item number. – Check your positions.
  • Not clearing lists at the start. – Use "delete all".
  • Trying to use a list as a variable. – Lists are collections.

βœ… Best Practices

  • Give your lists clear names.
  • Clear lists at the start of a game.
  • Use loops to process lists.
  • Use lists for collections of data.
  • Test your list operations.

πŸ“ End-of-Module Summary

Great job! You have learned about lists:

  • What is a list? – A collection of items.
  • Creating lists: Use "Make a List".
  • Adding items: Use "add".
  • Removing items: Use "delete".
  • Changing items: Use "replace".
  • Getting items: Use "item", "length", "contains".
  • Looping: Process all items.
  • Uses: High scores, inventory, cards.

You can now manage collections of data in your projects!

❓ Frequently Asked Questions

  • Q1: What is a list?
    A collection of items.
  • Q2: How do I create a list?
    Click "Make a List" in Variables.
  • Q3: How do I add an item?
    Use "add item to list".
  • Q4: How do I remove an item?
    Use "delete 1 of list".
  • Q5: How do I change an item?
    Use "replace item".
  • Q6: How do I get the length of a list?
    Use "length of list".
  • Q7: How do I search a list?
    Use "list contains".
  • Q8: What are lists used for?
    High scores, inventory, cards.
  • Q9: Can I have a list of lists?
    Yes – advanced, but possible!
  • Q10: When should I use a list vs variables?
    Lists for collections; variables for single values.

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. ListA. A single value
2. VariableB. A collection of items
3. AddC. Remove an item
4. DeleteD. Insert an item

(Answers: 1-B, 2-A, 3-D, 4-C)

🎭 Scenario-based Exercise

Scenario: A student wants to create a game with a high scores leaderboard. When a game ends, the player's score is added to the list, and the top 5 scores are displayed.

Question: How would you use a list to implement this?

πŸ‘₯ Group Activity

In groups of 4, each person creates a list for a different purpose – one for high scores, one for inventory, one for a shopping list, and one for a to-do list.

✍️ Individual Activity

Create a list called "fruits" with 5 fruits. Add, remove, and change items. Display the length of the list.

πŸ› οΈ Mini Project

Create a simple game that uses a list for high scores. When a game ends, add the score to the list and display the top scores.

πŸ“‹ Practical Assignment

Create a project that uses a list for inventory. Let the player collect items and display the inventory.

πŸ”‘ Key Takeaways

  • Lists store collections of data.
  • Create lists with "Make a List".
  • Add, remove, and change items.
  • Use loops to process lists.
  • Lists are perfect for high scores, inventory, and cards.

πŸ’¬ Classroom Discussion Questions

  • What is the difference between a variable and a list?
  • How can you use a list in a game?
  • What are some everyday examples of lists?
  • Why are lists important in programming?

πŸ”œ Preparation for Module 3

In Module 3, we will explore Custom Blocks – Reusable Code. You will learn how to create your own blocks to make your code cleaner and more reusable.

Think about a task you repeat often in your code – we will learn how to turn it into a custom block!


You have completed Module 2 – you are now a list master! πŸŽ‰

4

Module Three

Module 3: Custom Blocks – Reusable Code

πŸ“˜ Module 3: Custom Blocks – Reusable Code

β€œCreating your own building blocks.”

🌟 Module Introduction

In Modules 1 and 2, we reviewed the basics and learned about lists. Now it's time to learn one of the most powerful features of Scratch: custom blocks.

Custom blocks are blocks you create yourself. They let you reuse code, make your projects cleaner, and save you time. Think of them like your own special tools – once you make them, you can use them again and again.

Imagine you are building a house. Instead of making each nail from scratch, you have a hammer and nails ready. Custom blocks are like that – they are your coding tools.

In this module, we will learn how to create custom blocks, add inputs to them, and use them to simplify our projects. Let's start building!

🎯 Learning Objectives

  • Define what custom blocks are and why they are useful.
  • Create custom blocks using the "My Blocks" category.
  • Add inputs (parameters) to custom blocks.
  • Use custom blocks to simplify complex scripts.
  • Create reusable systems with custom blocks.
  • Understand how custom blocks make code cleaner and more organized.

πŸ“– Warm-up Story: The Toolbox

Imagine you are a carpenter. You have a toolbox with many tools – a hammer, a saw, a screwdriver. Each tool is used for a specific job. When you need to build something, you use the right tool.

Custom blocks are like your toolbox. You create blocks for specific tasks – like a "jump" block or a "shoot" block. Then, whenever you need that action, you just use your block instead of writing the same code again.

This is the power of custom blocks – they make you a more efficient coder!

πŸ“š Main Lessons

Lesson 1: What Are Custom Blocks?

Definition: Custom blocks are blocks you create yourself to reuse code.

Why important: They save time, reduce errors, and make code cleaner.

Simple explanation: It's like creating your own tool – you can use it whenever you need.

Real-life example: A recipe – you use it many times to cook the same dish.

School example: A math formula – you use it for different problems.

Home example: A cleaning routine – you follow the same steps each week.

Nigerian example: A traditional dance move – you repeat it in different dances.

    Custom Blocks:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Define jump                               β”‚
    β”‚    repeat 10                               β”‚
    β”‚      change y by 5                        β”‚
    β”‚    end                                     β”‚
    β”‚  Use it like any other block!              β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Custom blocks are your own reusable blocks.

Lesson 2: Why Use Custom Blocks?

  • Reuse: Write once, use many times.
  • Organization: Keep your code clean and tidy.
  • Debugging: Fix errors in one place.
  • Readability: Your code is easier to understand.
  • Speed: Code faster by reusing blocks.

Nigerian example: A game uses a "jump" block for the player, and it works perfectly every time.

βœ… Mini summary: Custom blocks save time and keep code organized.

Lesson 3: Creating a Custom Block

Why important: You need to know how to create your own blocks.

How to create:

  1. Click the "My Blocks" category.
  2. Click "Make a Block".
  3. Enter a name for your block (e.g., "jump").
  4. Click "OK".
  5. Add the code that defines what the block does.

Nigerian example: A student creates a block called "dance".

βœ… Mini summary: Click "Make a Block" to create one.

Lesson 4: Adding Inputs to Custom Blocks

Definition: Inputs are values you can pass to a custom block.

Why important: Inputs make your blocks flexible and powerful.

How to add inputs:

  • When creating a block, click "Add an input".
  • Name the input (e.g., "distance").
  • Use the input in your block's code.

Nigerian example: A "move distance" block takes a distance input.

βœ… Mini summary: Inputs let you customize how your block works.

Lesson 5: Using Custom Blocks in Your Code

Why important: You need to know how to use the blocks you created.

How to use:

  • Find your custom block in the "My Blocks" category.
  • Drag it into your script like any other block.
  • If it has inputs, fill them in.

Nigerian example: A game uses the "jump" block whenever the player presses space.

βœ… Mini summary: Use custom blocks like built-in blocks.

Lesson 6: Example – Jump Block

Steps:

  1. Create a block called "jump".
  2. Add code: change y by 10, wait 0.1 seconds, change y by -10.
  3. Use "jump" whenever the player presses space.

Nigerian example: A platformer game uses a "jump" block.

βœ… Mini summary: Create reusable blocks for common actions.

Lesson 7: Example – Shoot Block

Steps:

  1. Create a block called "shoot".
  2. Add code: create a clone of a bullet, set its direction, move it.
  3. Use "shoot" whenever the player clicks.

Nigerian example: A space shooter uses a "shoot" block.

βœ… Mini summary: Custom blocks are great for game actions.

Lesson 8: Example – Score Update Block

Steps:

  1. Create a block called "updateScore".
  2. Add an input called "points".
  3. Add code: change score by points, say score.
  4. Use "updateScore 5" when the player scores.

Nigerian example: A game uses "updateScore" to change the score.

βœ… Mini summary: Custom blocks can handle complex tasks.

Lesson 9: Custom Blocks with Multiple Inputs

Why important: Some actions need more than one input.

How to create:

  • Add multiple inputs when creating the block.
  • Use all inputs in the block's code.

Nigerian example: A "move to" block takes x and y inputs.

βœ… Mini summary: Use multiple inputs for flexible blocks.

Lesson 10: Custom Blocks and Lists

Why important: Combining custom blocks with lists is powerful.

How to use:

  • Create a block that adds an item to a list.
  • Create a block that removes an item.
  • Create a block that displays the list.

Nigerian example: A game uses custom blocks to manage a high scores list.

βœ… Mini summary: Custom blocks and lists work well together.

Lesson 11: Organizing Code with Custom Blocks

Why important: Organized code is easier to understand and fix.

Tips:

  • Group related actions into custom blocks.
  • Use clear block names.
  • Keep blocks short and focused.

Nigerian example: A game has blocks like "initGame", "playerMove", "checkCollision".

βœ… Mini summary: Custom blocks help organize your code.

Lesson 12: Reusing Custom Blocks Across Projects

Why important: You can reuse blocks in multiple projects.

How to reuse:

  • Save your project with custom blocks.
  • Open it and copy the blocks to a new project.
  • Use the "backpack" feature to save blocks.

Nigerian example: A student reuses a "dance" block in different animations.

βœ… Mini summary: Custom blocks can be reused across projects.

πŸ“Œ Key Vocabulary

Custom block – A block you create.
Input – A value passed to a block.
Reuse – Using code again.
Organization – Keeping code tidy.
Debug – Fixing errors.
My Blocks – Category for custom blocks.
Parameter – Another word for input.
Reusable – Can be used many times.
Efficiency – Working faster and better.
Backpack – Scratch's storage for blocks.

🧠 Important Concepts

  • Reusability: Write once, use many times.
  • Modularity: Break code into small, manageable parts.
  • Efficiency: Work smarter, not harder.

πŸ”’ Steps to Perform Key Tasks

Task 1: Create a Custom Block

  1. Click "My Blocks".
  2. Click "Make a Block".
  3. Name it "sayHello".
  4. Add code: say "Hello!".
  5. Use it in your script.

Task 2: Add an Input to a Block

  1. Create a block called "sayWord".
  2. Add an input called "word".
  3. Add code: say word.
  4. Use it: sayWord "Hello!".

Task 3: Create a Block with Multiple Inputs

  1. Create a block called "moveTo".
  2. Add inputs: "x" and "y".
  3. Add code: go to x: x y: y.
  4. Use it: moveTo 50 50.
βœ… Mini summary: Follow these steps to create custom blocks.

πŸ”’ Step-by-step: Creating a Jump Block

  1. Click "My Blocks" – open the category.
  2. Click "Make a Block" – give it a name: "jump".
  3. Add code – change y by 10, wait 0.1 seconds, change y by -10.
  4. Use the block – in your game, use "jump".
  5. Test – make sure it works.

🧸 Fun Examples for Children

  • Pet game: Create a "feed" block for feeding your pet.
  • Dance game: Create a "spin" block for dancing.

🏠 Everyday Examples

  • Family game: Create a "rollDice" block for a board game.
  • School project: Create a "calculateAverage" block.

πŸ‘ͺ Parent Tips

  • Show your child how custom blocks are like tools in a toolbox.
  • Encourage them to think about actions they repeat often.
  • Help them create their own custom blocks.

πŸ’‘ Interesting Facts

  • Custom blocks are also called "procedures" or "functions".
  • Professional programmers use functions all the time.
  • Scratch's custom blocks make coding fun and easy.

❓ Did You Know?

  • You can use the "backpack" to save custom blocks for other projects.
  • Custom blocks can be shared with other Scratch users.

πŸ”” Remember This

  • Custom blocks save time.
  • They make your code cleaner.
  • They can have inputs.
  • They can be reused across projects.
  • They are powerful tools.

⚠️ Common Mistakes

  • Not using custom blocks. – Use them to save time.
  • Giving blocks unclear names. – Use clear names.
  • Not using inputs. – Inputs make blocks flexible.
  • Making blocks too long. – Keep blocks short and focused.

βœ… Best Practices

  • Give blocks clear, descriptive names.
  • Use inputs for flexibility.
  • Keep blocks short and focused.
  • Organize your code with custom blocks.
  • Reuse blocks across projects.
  • Test your blocks after creating them.

πŸ“Š Comparison: Without vs With Custom Blocks

Without Custom BlocksWith Custom Blocks
Repeated code everywhereOne block, used many times
Hard to fix errorsFix in one place
Messy codeClean, organized code
Slow to codeFaster coding

πŸ“ End-of-Module Summary

Great work! You have learned about custom blocks:

  • What are they? – Your own reusable blocks.
  • Why use them? – Save time, organize code, fix errors easily.
  • Creating blocks: Use "Make a Block" in My Blocks.
  • Adding inputs: Make blocks flexible.
  • Using blocks: Drag and use like built-in blocks.
  • Reusing: Use the backpack or copy across projects.

You can now create your own coding tools!

❓ Frequently Asked Questions

  • Q1: What is a custom block?
    A block you create yourself.
  • Q2: Why use custom blocks?
    To save time and organize code.
  • Q3: How do I create a custom block?
    Click "Make a Block" in My Blocks.
  • Q4: What is an input?
    A value passed to a block.
  • Q5: Can I have multiple inputs?
    Yes – add as many as you need.
  • Q6: How do I use a custom block?
    Drag it from My Blocks like any other block.
  • Q7: Can I reuse custom blocks?
    Yes – use the backpack or copy them.
  • Q8: What is the backpack?
    Scratch's storage for blocks and sprites.
  • Q9: Are custom blocks like functions?
    Yes – they are the Scratch version of functions.
  • Q10: How can I organize my code?
    Use custom blocks to group related actions.

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. Custom blockA. A value passed to a block
2. InputB. A block you create yourself
3. My BlocksC. Storage for blocks
4. BackpackD. Category for custom blocks

(Answers: 1-B, 2-A, 3-D, 4-C)

🎭 Scenario-based Exercise

Scenario: A student is creating a game with many actions – jumping, shooting, and collecting items. The code is becoming messy and hard to fix.

Question: How can custom blocks help organize this game?

πŸ‘₯ Group Activity

In groups of 4, each person creates a different custom block – one for movement, one for scoring, one for jumping, and one for shooting. Combine them into one project.

✍️ Individual Activity

Create a custom block called "greet" that takes a name as input and says "Hello, name!".

πŸ› οΈ Mini Project

Create a simple game with at least 3 custom blocks – one for movement, one for scoring, and one for jumping. Share your project.

πŸ“‹ Practical Assignment

Create a project that uses custom blocks to organize code. Write a short reflection on how custom blocks helped.

πŸ”‘ Key Takeaways

  • Custom blocks save time.
  • They make code cleaner.
  • Inputs make blocks flexible.
  • Blocks can be reused across projects.
  • Organization makes coding easier.

πŸ’¬ Classroom Discussion Questions

  • What custom block would you create first?
  • How can custom blocks help you code faster?
  • Why is organization important in coding?
  • What is the most useful custom block you have used?

πŸ”œ Preparation for Module 4

In Module 4, we will explore Game States and Structured Game Flow. You will learn how to control the flow of your game using states like start, play, win, and game over.

Think about a game you like – it probably has a start screen, a play state, and a game over screen. We will learn how to build that in Scratch!


You have completed Module 3 – you can now create your own blocks! πŸŽ‰

5

Module Four

Module 4: Game States and Structured Game Flow

πŸ“˜ Module 4: Game States and Structured Game Flow

β€œControlling your game like a director.”

🌟 Module Introduction

In Modules 1-3, we reviewed the basics, learned about lists, and created custom blocks. Now it's time to think about the flow of your game.

Every good game has a structure – a start screen, a play state, and a win or game over screen. This is called game states. Game states control what happens at each stage of your game.

Think of a movie – it has an opening, a middle, and an ending. A game is the same. Game states let you organize your game into clear stages.

In this module, we will learn how to create and manage game states in Scratch. Let's become game directors!

🎯 Learning Objectives

  • Understand the concept of game states.
  • Identify common game states: start, play, win, game over.
  • Use variables to track the current game state.
  • Create start screens and instructions.
  • Implement win and game over screens.
  • Manage transitions between states.
  • Design structured game flow.

πŸ“– Warm-up Story: The Movie Director

Imagine you are a movie director. Your movie has three parts – the beginning, the middle, and the end. Each part has different scenes, characters, and actions.

In a game, you are the director. You decide what happens at the start, during the game, and when the game ends. Game states are like the chapters of your movie.

By using game states, you can create a smooth, professional game that players will love.

πŸ“š Main Lessons

Lesson 1: What Are Game States?

Definition: Game states are the different phases of a game – start, play, win, game over.

Why important: Game states organize the flow of your game.

Simple explanation: It's like the chapters of a book – each chapter is a state.

Real-life example: A sports match has states – before, during, after.

School example: A lesson has states – introduction, teaching, practice.

Home example: A meal has states – preparing, eating, cleaning.

Nigerian example: A wedding has states – ceremony, reception, after-party.

    Game States:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Start β†’ Play β†’ Win / Game Over            β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Game states are the phases of your game.

Lesson 2: Why Use Game States?

  • Organization: Keep your code clean and logical.
  • Control: Decide what happens at each stage.
  • Player experience: Create a smooth, professional experience.
  • Easy updates: Change one state without affecting others.

Nigerian example: A game with a start screen, levels, and a win screen feels professional.

βœ… Mini summary: Game states make your game organized and professional.

Lesson 3: Common Game States

  • Start: Title screen, instructions, play button.
  • Play: The main game – player controls, scoring.
  • Win: When the player achieves the goal.
  • Game Over: When the player loses.
  • Pause: Optional – when the player pauses.
  • Level Complete: Between levels.
βœ… Mini summary: Common states include start, play, win, and game over.

Lesson 4: Tracking the Game State

Why important: You need to know which state the game is in.

How to track:

  • Create a variable called "gameState".
  • Assign a number or name to each state (e.g., 0=start, 1=play, 2=win, 3=game over).
  • Check the variable to decide what to do.

Nigerian example: A game uses "gameState" to show the right screen.

βœ… Mini summary: Use a variable to track the current game state.

Lesson 5: Creating a Start Screen

Why important: The start screen is the first thing players see.

Steps:

  1. Set gameState to "start".
  2. Add a backdrop with a title.
  3. Add a sprite that says "Click to start".
  4. When clicked, change gameState to "play".

Nigerian example: A game starts with "Welcome to Lagos Adventure".

βœ… Mini summary: The start screen introduces your game.

Lesson 6: Adding Instructions

Why important: Players need to know how to play.

How to add:

  • Add a "How to Play" button on the start screen.
  • Show instructions when clicked.
  • Use a separate backdrop or sprite for instructions.

Nigerian example: A game shows instructions in English and Pidgin.

βœ… Mini summary: Instructions help players understand your game.

Lesson 7: The Play State

Why important: This is where the action happens.

Steps:

  1. When gameState = "play", show the game backdrop.
  2. Activate player controls.
  3. Start scoring, lives, and enemies.
  4. Check for win or lose conditions.

Nigerian example: In "play" state, the player controls a character and collects items.

βœ… Mini summary: The play state is the main part of your game.

Lesson 8: The Win State

Why important: Winning feels rewarding.

Steps:

  1. When the player achieves the goal, set gameState to "win".
  2. Show a win message (e.g., "You Win!").
  3. Add a "Play Again" button.

Nigerian example: A game says "Congratulations! You collected all the flags!"

βœ… Mini summary: The win state celebrates the player's success.

Lesson 9: The Game Over State

Why important: Losing is part of the game.

Steps:

  1. When the player loses (e.g., lives = 0), set gameState to "game over".
  2. Show a game over message (e.g., "Game Over").
  3. Add a "Try Again" button.

Nigerian example: A game says "Try again! You can do it!"

βœ… Mini summary: The game over state shows the player they lost.

Lesson 10: Transitions Between States

Definition: Transitions are how you move from one state to another.

Why important: Smooth transitions make your game feel professional.

How to transition:

  • Change the gameState variable.
  • Hide/show sprites based on the state.
  • Use broadcasts to trigger state changes.

Nigerian example: A game fades from the start screen to the play state.

βœ… Mini summary: Transitions move the game from one state to another.

Lesson 11: Using Broadcasts for States

Why important: Broadcasts make state management cleaner.

How to use:

  • Broadcast "startGame" when the player clicks start.
  • Broadcast "winGame" when the player wins.
  • Use "when I receive" to trigger state changes.

Nigerian example: A game broadcasts "levelComplete" to move to the next level.

βœ… Mini summary: Broadcasts help manage state transitions.

Lesson 12: Structured Game Flow – Putting It All Together

Why important: A structured game is easier to build and play.

Steps:

  1. Plan your game states.
  2. Create a variable to track the state.
  3. Use "when green flag clicked" to set the start state.
  4. Use "if" blocks to handle each state.
  5. Use broadcasts to transition between states.
  6. Test your game flow.

Nigerian example: A complete game with start, play, win, and game over states.

βœ… Mini summary: Structured game flow makes your game professional.

πŸ“Œ Key Vocabulary

Game state – A phase of a game.
Start – The opening screen.
Play – The main game.
Win – Victory state.
Game over – Loss state.
Transition – Moving between states.
Variable – Stores the game state.
Broadcast – Triggers state changes.
Flow – The order of states.
Structured – Organized and logical.

🧠 Important Concepts

  • Organization: Game states keep your code organized.
  • Control: You control the flow of the game.
  • Experience: A well-structured game is more enjoyable.

πŸ”’ Steps to Perform Key Tasks

Task 1: Create a Game State Variable

  1. Create a variable called "gameState".
  2. Set it to "start" at the beginning.

Task 2: Create a Start Screen

  1. Add a backdrop with a title.
  2. Add a sprite that says "Click to Start".
  3. When clicked, set gameState to "play".

Task 3: Create a Win Screen

  1. When the player wins, set gameState to "win".
  2. Show a win message.
  3. Add a "Play Again" button.
βœ… Mini summary: Follow these steps to implement game states.

πŸ”’ Step-by-step: Creating a Game with States

  1. Create a gameState variable – set to "start".
  2. Create a start screen – title and instructions.
  3. When "start" is clicked – change state to "play".
  4. In play state – run the game.
  5. When the player wins – change state to "win".
  6. In win state – show win message and "Play Again".
  7. When "Play Again" is clicked – reset the game.

🧸 Fun Examples for Children

  • Pet game: Start screen, play state (feed the pet), and a win state.
  • Space game: Start, play, win, and game over states.

🏠 Everyday Examples

  • Family game: A board game with start, play, and end states.
  • School quiz: Start, questions, and results states.

πŸ‘ͺ Parent Tips

  • Show your child how games have start, play, and end screens.
  • Help them plan their game states before coding.
  • Encourage them to add clear instructions.

πŸ’‘ Interesting Facts

  • Professional games always use game states.
  • Game states are also called "game modes".
  • Well-designed game states improve player experience.

❓ Did You Know?

  • Some games have dozens of states (e.g., menus, options, levels).
  • You can use game states to create a "pause" feature.

πŸ”” Remember This

  • Game states organize your game.
  • Common states: start, play, win, game over.
  • Use a variable to track the state.
  • Use broadcasts for smooth transitions.
  • A structured game is more professional.

⚠️ Common Mistakes

  • Not using game states. – Use them to organize your code.
  • Forgetting to change the state. – Always update the state.
  • Not resetting the game. – Reset all variables when playing again.
  • Messy transitions. – Use broadcasts for clean transitions.

βœ… Best Practices

  • Plan your game states before coding.
  • Use a variable to track the state.
  • Use broadcasts for transitions.
  • Reset variables when restarting.
  • Add clear instructions on the start screen.
  • Test all state transitions.

πŸ“Š Comparison: With vs Without Game States

Without Game StatesWith Game States
Messy codeOrganized code
Hard to control flowEasy to control flow
No clear start/endClear start and end
Confusing for playersProfessional experience

πŸ“ End-of-Module Summary

Great work! You have learned about game states:

  • What are game states? – Phases of a game.
  • Common states: Start, play, win, game over.
  • Tracking: Use a variable.
  • Transitions: Use broadcasts.
  • Structured flow: Organize your game.

You can now create professional, well-structured games!

❓ Frequently Asked Questions

  • Q1: What is a game state?
    A phase of a game.
  • Q2: What are common game states?
    Start, play, win, game over.
  • Q3: How do I track the game state?
    Use a variable called "gameState".
  • Q4: What is a transition?
    Moving from one state to another.
  • Q5: How do I create a start screen?
    Set gameState to "start" and show the title.
  • Q6: How do I show a win screen?
    Set gameState to "win" and show a message.
  • Q7: How do I reset the game?
    Reset variables and go back to "start".
  • Q8: What is a broadcast?
    A message that triggers state changes.
  • Q9: Why are game states important?
    They organize your game.
  • Q10: Can I have more than 4 states?
    Yes – you can have as many as you need.

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. Game stateA. Moving from one state to another
2. TransitionB. A phase of a game
3. StartC. The main action of the game
4. PlayD. The opening screen

(Answers: 1-B, 2-A, 3-D, 4-C)

🎭 Scenario-based Exercise

Scenario: A student is creating a game with a start screen, gameplay, and a win screen. They want to add a "Game Over" screen when the player loses.

Question: How would you implement these game states?

πŸ‘₯ Group Activity

In groups of 4, each person designs a different game state for the same game – one does start, one does play, one does win, and one does game over. Combine them.

✍️ Individual Activity

Create a game with at least 3 states: start, play, and win or game over. Save your project.

πŸ› οΈ Mini Project

Create a complete game with start, play, win, and game over states. Add instructions and a "Play Again" button.

πŸ“‹ Practical Assignment

Create a game with structured game states. Write a reflection on how states helped organize your code.

πŸ”‘ Key Takeaways

  • Game states organize your game.
  • Common states: start, play, win, game over.
  • Use a variable to track the state.
  • Use broadcasts for transitions.
  • A structured game is professional.

πŸ’¬ Classroom Discussion Questions

  • What are the benefits of using game states?
  • How can you make transitions smooth?
  • Why is it important to reset the game?
  • What other states could you add to a game?

πŸ”œ Preparation for Module 5

In Module 5, we will explore Enemy Behaviors and Simple AI. You will learn how to create enemies that chase, patrol, and react to the player.

Think about a game with enemies – how do they move and behave? We will learn how to make them smart!


You have completed Module 4 – your games are now structured! πŸŽ‰

6

Module Five

Module 5: Enemy Behaviors and Simple AI

πŸ“˜ Module 5: Enemy Behaviors and Simple AI

β€œMaking your enemies smart and challenging.”

🌟 Module Introduction

In Modules 1-4, we learned the foundations of Level 2 – lists, custom blocks, and game states. Now it's time to make your games more exciting with enemies!

Enemies make games challenging and fun. But enemies that just move in a straight line are boring. In this module, we will learn how to create smart enemies that chase, patrol, and react to the player.

This is called Artificial Intelligence (AI) – making enemies behave like they are thinking. We will learn how to create different enemy behaviors and make your games more engaging.

Let's make your enemies smart!

🎯 Learning Objectives

  • Understand what Artificial Intelligence (AI) is in games.
  • Create different enemy movement patterns (patrol, chase, random).
  • Use sensing blocks for enemy awareness (touching player, distance).
  • Implement chase behavior – enemies follow the player.
  • Implement patrol behavior – enemies move back and forth.
  • Create simple AI state machines (idle, chase, attack).

πŸ“– Warm-up Story: The Smart Enemies

Imagine you are playing a game. You are a hero, and there are enemies that want to catch you. Some enemies move back and forth (patrol). Some enemies chase you (chase). Some enemies wait and then attack when you get close.

These enemies feel alive because they have AI. They are not just moving randomly – they are responding to you.

In this module, we will learn how to create enemies like these. Let's make your game more challenging!

πŸ“š Main Lessons

Lesson 1: What is AI in Games?

Definition: AI (Artificial Intelligence) in games is code that makes characters behave in smart ways.

Why important: AI makes games challenging and fun.

Simple explanation: It's like giving enemies a brain – they can think and react.

Real-life example: A robot that follows you.

School example: A classmate who reacts to what you say.

Home example: A pet that comes when you call it.

Nigerian example: A market vendor who approaches you when you look at their goods.

    AI in Games:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Patrol β†’ moves back and forth             β”‚
    β”‚  Chase β†’ follows the player                β”‚
    β”‚  Attack β†’ attacks when close               β”‚
    β”‚  Idle β†’ waits and watches                  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: AI makes enemies behave like they are thinking.

Lesson 2: Enemy Movement – Patrol

Definition: Patrol means moving back and forth between two points.

Why important: Patrol is the simplest and most common enemy behavior.

How to create:

  • Move the enemy in one direction.
  • When it reaches the edge, turn around.
  • Use "if on edge, bounce" or custom code.

Nigerian example: A guard walking back and forth.

βœ… Mini summary: Patrol is moving back and forth.

Lesson 3: Enemy Movement – Chase

Definition: Chase means following the player.

Why important: Chase is more challenging and exciting.

How to create:

  • Get the player's position.
  • Move the enemy towards the player.
  • Use "point towards player" and "move 2 steps".

Nigerian example: A lion chasing a gazelle.

βœ… Mini summary: Chase makes enemies follow the player.

Lesson 4: Enemy Movement – Random

Definition: Random means moving in random directions.

Why important: Random movement is unpredictable.

How to create:

  • Use "pick random" to choose a direction.
  • Move in that direction for a short time.
  • Repeat.

Nigerian example: A fly moving randomly.

βœ… Mini summary: Random movement is unpredictable.

Lesson 5: Sensing the Player

Definition: Sensing means detecting the player.

Why important: Enemies need to know where the player is.

How to sense:

  • Use "touching player" to detect contact.
  • Use "distance to player" to measure how far.
  • Use "point towards player" to face them.

Nigerian example: A guard who sees you and starts chasing.

βœ… Mini summary: Sensing detects the player's presence.

Lesson 6: Chase Behavior – Step by Step

Steps:

  1. Add a sprite for the enemy.
  2. Add a "when green flag clicked" block.
  3. Add a "forever" loop.
  4. Add "point towards player".
  5. Add "move 2 steps".
  6. Add a wait block (0.1 seconds).

Nigerian example: An enemy chases the player.

βœ… Mini summary: Chase behavior follows the player.

Lesson 7: Patrol Behavior – Step by Step

Steps:

  1. Add a sprite for the enemy.
  2. Add a "when green flag clicked" block.
  3. Add a "forever" loop.
  4. Add "move 2 steps".
  5. Add "if on edge, bounce".
  6. Add a wait block (0.1 seconds).

Nigerian example: An enemy patrols back and forth.

βœ… Mini summary: Patrol moves back and forth.

Lesson 8: AI State Machines – Idle, Chase, Attack

Definition: A state machine is a way for an enemy to switch between different behaviors.

Why important: State machines make enemies more realistic.

States:

  • Idle: Enemy waits.
  • Chase: Enemy follows the player.
  • Attack: Enemy attacks when close.

Nigerian example: A guard who waits, then chases, then attacks.

βœ… Mini summary: State machines switch between behaviors.

Lesson 9: Creating an AI State Machine

Steps:

  1. Create a variable called "enemyState" for each enemy.
  2. Set it to "idle" at the start.
  3. If the player is far, stay "idle".
  4. If the player is close, switch to "chase".
  5. If touching the player, switch to "attack".

Nigerian example: An enemy with idle, chase, and attack states.

βœ… Mini summary: Use a variable to control enemy states.

Lesson 10: Attack Behavior

Definition: Attack means doing damage to the player.

Why important: Attack is the climax of enemy behavior.

How to create:

  • When the enemy touches the player, broadcast "hurt".
  • Reduce the player's lives.
  • Add a cooldown to prevent constant damage.

Nigerian example: An enemy bites the player.

βœ… Mini summary: Attack damages the player.

Lesson 11: Using Clones for Multiple Enemies

Why important: Clones let you have many enemies.

How to use:

  • Create a single enemy sprite.
  • Use "create clone of myself" to make copies.
  • Each clone can have its own behavior.
  • Use "when I start as a clone" to set up each enemy.

Nigerian example: A game with 5 enemies chasing the player.

βœ… Mini summary: Clones create multiple enemies.

Lesson 12: Combining AI with Other Concepts

Why important: AI works with lists, custom blocks, and game states.

Example:

  • Use a list to store enemy positions.
  • Use custom blocks for enemy behaviors.
  • Use game states to control when enemies are active.

Nigerian example: A complete game with smart enemies.

βœ… Mini summary: Combine AI with other concepts for powerful games.

πŸ“Œ Key Vocabulary

AI – Artificial Intelligence.
Patrol – Moving back and forth.
Chase – Following the player.
Attack – Damaging the player.
Idle – Waiting.
State machine – Switching behaviors.
Sensing – Detecting the player.
Clone – A copy of a sprite.
Behavior – How an enemy acts.
Cooldown – A pause between attacks.

🧠 Important Concepts

  • Variety: Different enemy behaviors make games interesting.
  • Challenge: Smart enemies make games harder and more fun.
  • Balance: Enemies should be challenging but not impossible.

πŸ”’ Steps to Perform Key Tasks

Task 1: Create a Patrol Enemy

  1. Add an enemy sprite.
  2. Add "when green flag clicked".
  3. Add "forever" loop.
  4. Add "move 2 steps".
  5. Add "if on edge, bounce".
  6. Test it.

Task 2: Create a Chase Enemy

  1. Add an enemy sprite.
  2. Add "when green flag clicked".
  3. Add "forever" loop.
  4. Add "point towards player".
  5. Add "move 2 steps".
  6. Test it.

Task 3: Create an AI State Machine

  1. Create a variable "enemyState".
  2. Set it to "idle".
  3. If distance to player > 100, stay idle.
  4. If distance < 100, switch to chase.
  5. If touching player, switch to attack.
  6. Test it.
βœ… Mini summary: Follow these steps to create enemy behaviors.

πŸ”’ Step-by-step: Creating a Chase Enemy

  1. Add a sprite – choose an enemy.
  2. Add "when green flag clicked" – start the script.
  3. Add a "forever" loop – keep the behavior running.
  4. Add "point towards player" – face the player.
  5. Add "move 2 steps" – move towards the player.
  6. Add a "wait 0.1 seconds" – control speed.
  7. Test your enemy – it should chase the player.

🧸 Fun Examples for Children

  • Pet game: An enemy pet that chases you.
  • Space game: Enemies that patrol and chase.

🏠 Everyday Examples

  • Family game: Enemies in a board game.
  • School project: A game with smart enemies.

πŸ‘ͺ Parent Tips

  • Show your child how enemies in games have different behaviors.
  • Help them create simple enemy behaviors.
  • Encourage them to experiment with different AI states.

πŸ’‘ Interesting Facts

  • AI in games is called "game AI".
  • Some game AI is very advanced.
  • Simple AI can be created with just a few blocks.

❓ Did You Know?

  • AI in games can use "pathfinding" to find the best route.
  • Some enemies use "stealth" to avoid the player.

πŸ”” Remember This

  • AI makes enemies smart.
  • Common behaviors: patrol, chase, attack, idle.
  • Use sensing to detect the player.
  • State machines switch between behaviors.
  • Clones create multiple enemies.

⚠️ Common Mistakes

  • Enemies too fast or too slow. – Adjust speed.
  • Enemies not detecting player. – Check sensing blocks.
  • No cooldown on attacks. – Add a wait or cooldown.
  • Too many clones. – Limit the number of clones.

βœ… Best Practices

  • Start with simple behaviors (patrol).
  • Add chase behavior gradually.
  • Use cooldowns for attacks.
  • Limit the number of clones.
  • Test enemy behaviors thoroughly.
  • Balance difficulty for fun gameplay.

πŸ“Š Comparison: Enemy Behaviors

BehaviorDescriptionDifficulty
PatrolMoves back and forthEasy
ChaseFollows the playerMedium
AttackDamages the playerHard
IdleWaitsEasy

πŸ“ End-of-Module Summary

Great work! You have learned about enemy behaviors and AI:

  • AI: Makes enemies smart.
  • Behaviors: Patrol, chase, attack, idle.
  • Sensing: Detect the player.
  • State machines: Switch between behaviors.
  • Clones: Create multiple enemies.

You can now create challenging and fun enemies for your games!

❓ Frequently Asked Questions

  • Q1: What is AI in games?
    Smart behavior for enemies.
  • Q2: What is patrol?
    Moving back and forth.
  • Q3: What is chase?
    Following the player.
  • Q4: What is a state machine?
    Switching between behaviors.
  • Q5: How do I detect the player?
    Use sensing blocks.
  • Q6: How do I create multiple enemies?
    Use clones.
  • Q7: What is a cooldown?
    A pause between attacks.
  • Q8: How do I balance enemy difficulty?
    Adjust speed and damage.
  • Q9: Can enemies use pathfinding?
    Yes – but that's advanced.
  • Q10: What is the most common enemy behavior?
    Patrol and chase.

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. PatrolA. Follows the player
2. ChaseB. Moves back and forth
3. AttackC. Damages the player
4. IdleD. Waits

(Answers: 1-B, 2-A, 3-C, 4-D)

🎭 Scenario-based Exercise

Scenario: A student wants to create a game where enemies patrol and chase the player when they get close.

Question: How would you implement this with a state machine?

πŸ‘₯ Group Activity

In groups of 4, each person creates a different enemy behavior – one patrols, one chases, one attacks, and one is idle. Combine them into one game.

✍️ Individual Activity

Create a simple game with one enemy that chases the player. Save your project.

πŸ› οΈ Mini Project

Create a game with at least two different enemy behaviors (e.g., patrol and chase). Use a state machine for one enemy.

πŸ“‹ Practical Assignment

Create a game with enemies that use AI. Write a reflection on how you created the enemy behaviors.

πŸ”‘ Key Takeaways

  • AI makes enemies smart.
  • Behaviors: patrol, chase, attack, idle.
  • Sensing detects the player.
  • State machines switch behaviors.
  • Clones create multiple enemies.

πŸ’¬ Classroom Discussion Questions

  • What is your favorite enemy behavior?
  • How can you make enemies more challenging?
  • What other enemy behaviors could you create?
  • How does AI improve a game?

πŸ”œ Preparation for Module 6

In Module 6, we will explore Spawning Systems and Object Management. You will learn how to create and manage multiple objects dynamically.

Think about a game where objects appear and disappear – like falling stars or enemies. We will learn how to manage them!


You have completed Module 5 – your enemies are now smart! πŸŽ‰

7

Module Six

Module 6: Spawning Systems and Object Management

πŸ“˜ Module 6: Spawning Systems and Object Management

β€œCreating and managing objects dynamically.”

🌟 Module Introduction

In Modules 1-5, we learned about lists, custom blocks, game states, and enemy AI. Now it's time to learn how to create and manage objects dynamically – spawning them when needed and deleting them when they are no longer needed.

Think of a game where enemies appear (spawn) at random times, or where objects fall from the sky. These objects need to be created, managed, and removed efficiently.

In this module, we will learn how to use cloning and timing to create spawning systems. We will also learn how to manage object lifetimes and use object pooling for performance.

Let's learn how to spawn and manage objects like a pro!

🎯 Learning Objectives

  • Understand what spawning systems are and why they are important.
  • Use cloning to spawn objects dynamically.
  • Control spawn timing and rates.
  • Create random spawning systems.
  • Manage object lifetimes and deletion.
  • Understand object pooling concepts.

πŸ“– Warm-up Story: The Falling Stars

Imagine a game where stars fall from the sky, and the player has to catch them. The stars appear (spawn) at random times and positions, and they disappear when they reach the bottom or are caught.

This is a spawning system. The stars are created dynamically, and they are managed automatically. Without a spawning system, you would have to add every star manually – which would be impossible!

In this module, we will learn how to create systems like this in Scratch.

πŸ“š Main Lessons

Lesson 1: What is a Spawning System?

Definition: A spawning system creates objects (like enemies or items) during the game.

Why important: Spawning systems make games dynamic and interesting.

Simple explanation: It's like a factory that produces objects on demand.

Real-life example: A vending machine that dispenses items when you press a button.

School example: A teacher handing out worksheets to students.

Home example: A parent giving snacks to children.

Nigerian example: A market vendor restocking items as they sell.

    Spawning System:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Factory β†’ creates objects on demand       β”‚
    β”‚  Objects β†’ enemies, items, power-ups       β”‚
    β”‚  Timing β†’ when and how often to spawn      β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Spawning systems create objects during the game.

Lesson 2: Why Use Spawning Systems?

  • Dynamic: Objects appear as needed.
  • Efficient: No need to add all objects manually.
  • Unlimited: Can create endless objects.
  • Variety: Random spawning creates variety.

Nigerian example: A game where enemies keep appearing until the player wins.

βœ… Mini summary: Spawning systems make games dynamic and efficient.

Lesson 3: Using Clones for Spawning

Definition: Cloning is creating copies of a sprite.

Why important: Cloning is the easiest way to spawn objects in Scratch.

How to use:

  • Use "create clone of myself".
  • Use "when I start as a clone" to set up each clone.
  • Use "delete this clone" to remove it.

Nigerian example: A game spawns enemies using clones.

βœ… Mini summary: Cloning is the easiest way to spawn objects.

Lesson 4: Controlling Spawn Timing

Why important: Timing controls how often objects appear.

How to control:

  • Use "wait" blocks to control timing.
  • Use "repeat" loops to spawn multiple objects.
  • Use "forever" loops to keep spawning.

Nigerian example: Enemies spawn every 2 seconds.

βœ… Mini summary: Timing controls how often objects spawn.

Lesson 5: Random Spawning

Definition: Random spawning means creating objects at random positions and times.

Why important: Random spawning makes games unpredictable and exciting.

How to create:

  • Use "pick random" for position.
  • Use "pick random" for timing.

Nigerian example: Stars fall at random positions and times.

βœ… Mini summary: Random spawning creates variety and excitement.

Lesson 6: Object Lifetimes – When to Delete

Definition: Lifetime is how long an object exists before being deleted.

Why important: Deleting objects keeps your game running smoothly.

When to delete:

  • When the object reaches the edge.
  • When the object is collected by the player.
  • After a certain amount of time.

Nigerian example: A falling star is deleted when it reaches the bottom.

βœ… Mini summary: Objects should be deleted when they are no longer needed.

Lesson 7: Deleting Clones

Why important: Too many clones slow down your game.

How to delete:

  • Use "delete this clone".
  • Add conditions to trigger deletion.

Nigerian example: Enemies are deleted when they touch the player.

βœ… Mini summary: Delete clones to keep your game fast.

Lesson 8: Object Pooling – Advanced Management

Definition: Object pooling means reusing objects instead of creating new ones.

Why important: Object pooling improves performance.

How to use:

  • Create a pool of objects at the start.
  • When you need an object, take one from the pool.
  • When done, return it to the pool.

Nigerian example: A game reuses bullets instead of creating new ones.

βœ… Mini summary: Object pooling reuses objects for better performance.

Lesson 9: Spawning in Waves

Definition: Wave spawning means creating groups of objects at once.

Why important: Waves create patterns and challenges.

How to create:

  • Use a "repeat" loop to spawn multiple objects.
  • Use a "wait" block between waves.
  • Increase difficulty in later waves.

Nigerian example: A game spawns 5 enemies at a time in waves.

βœ… Mini summary: Wave spawning creates groups of objects.

Lesson 10: Spawning with Custom Blocks

Why important: Custom blocks make spawning code cleaner.

How to use:

  • Create a custom block called "spawnEnemy".
  • Add code to create a clone and set its position.
  • Use the block whenever you need to spawn.

Nigerian example: A game uses "spawnEnemy" to create enemies.

βœ… Mini summary: Custom blocks make spawning code cleaner.

Lesson 11: Combining Spawning with AI

Why important: Spawning and AI work together.

How to combine:

  • Spawn enemies with different AI behaviors.
  • Use random spawning for variety.
  • Use wave spawning for difficulty.

Nigerian example: A game spawns enemies that chase the player.

βœ… Mini summary: Combine spawning and AI for powerful games.

Lesson 12: Performance Tips

  • Limit clones: Delete clones that are not needed.
  • Use object pooling: Reuse objects when possible.
  • Avoid too many clones: Keep the number of clones manageable.
  • Test performance: Make sure your game runs smoothly.
βœ… Mini summary: Performance tips keep your game fast.

πŸ“Œ Key Vocabulary

Spawn – Create an object.
Clone – A copy of a sprite.
Timing – When objects spawn.
Random – Unpredictable.
Lifetime – How long an object exists.
Delete – Remove an object.
Pooling – Reusing objects.
Wave – A group of objects.
Performance – How fast your game runs.
Dynamic – Changing and responsive.

🧠 Important Concepts

  • Efficiency: Delete objects when they are no longer needed.
  • Variety: Random spawning creates interesting games.
  • Performance: Too many clones can slow down your game.

πŸ”’ Steps to Perform Key Tasks

Task 1: Spawn Enemies Every 2 Seconds

  1. Add an enemy sprite.
  2. Add "when green flag clicked".
  3. Add "forever" loop.
  4. Add "create clone of myself".
  5. Add "wait 2 seconds".
  6. Add "when I start as a clone" – set position and move.

Task 2: Random Spawning

  1. Add "go to x: pick random -200 to 200 y: 180".
  2. Add "show".
  3. Add movement code.

Task 3: Delete Clones

  1. Add "if y position < -180, delete this clone".
  2. Add "if touching player, delete this clone".
βœ… Mini summary: Follow these steps to create spawning systems.

πŸ”’ Step-by-step: Creating a Falling Star System

  1. Create a star sprite – choose a star from the library.
  2. Add "when green flag clicked" – hide the original.
  3. Add a "forever" loop – spawn stars.
  4. Add "create clone of myself" – create a new star.
  5. Add "wait pick random 1 to 3" – random timing.
  6. Add "when I start as a clone" – set random x position.
  7. Add "repeat until y < -180" – move down.
  8. Add "change y by -5" – fall speed.
  9. Add "delete this clone" – delete when off-screen.
  10. Test your game – stars should fall from the sky.

🧸 Fun Examples for Children

  • Pet game: Spawn food for your pet.
  • Space game: Spawn enemies and power-ups.

🏠 Everyday Examples

  • Family game: Spawn obstacles in a racing game.
  • School project: Spawn questions in a quiz game.

πŸ‘ͺ Parent Tips

  • Show your child how objects appear in games.
  • Help them understand the importance of deleting objects.
  • Encourage them to create their own spawning systems.

πŸ’‘ Interesting Facts

  • Spawning systems are used in almost every game.
  • Object pooling is used in professional game development.
  • Too many objects can slow down a game.

❓ Did You Know?

  • Some games spawn hundreds of objects at once.
  • Object pooling is a common optimization technique.

πŸ”” Remember This

  • Spawn objects dynamically.
  • Use clones for spawning.
  • Control timing with "wait".
  • Use random positions and timing.
  • Delete clones when they are no longer needed.
  • Use object pooling for performance.

⚠️ Common Mistakes

  • Not deleting clones. – Delete them to keep performance.
  • Spawning too many objects. – Limit the number of clones.
  • No random variation. – Use random for variety.
  • Objects spawning at the same position. – Randomize positions.

βœ… Best Practices

  • Delete clones when they are off-screen.
  • Limit the number of clones.
  • Use random positions and timing.
  • Use object pooling for performance.
  • Test your spawning system thoroughly.

πŸ“Š Comparison: Spawning Methods

MethodDescriptionPerformance
CloningCreate copies of a spriteGood
Object poolingReuse objectsBest
ManualAdd objects manuallyPoor

πŸ“ End-of-Module Summary

Great work! You have learned about spawning systems:

  • Spawning: Creating objects dynamically.
  • Cloning: The easiest way to spawn.
  • Timing: Control when objects appear.
  • Random: Create variety.
  • Deletion: Remove objects when done.
  • Pooling: Reuse objects for performance.

You can now create dynamic games with spawning systems!

❓ Frequently Asked Questions

  • Q1: What is a spawning system?
    Creates objects during the game.
  • Q2: Why use clones?
    Clones are easy to create and manage.
  • Q3: How do I control timing?
    Use "wait" blocks.
  • Q4: What is random spawning?
    Objects at random positions and times.
  • Q5: How do I delete clones?
    Use "delete this clone".
  • Q6: What is object pooling?
    Reusing objects instead of creating new ones.
  • Q7: Why delete clones?
    To keep your game fast.
  • Q8: What is wave spawning?
    Spawning groups of objects.
  • Q9: Can I combine spawning with AI?
    Yes – spawn enemies with AI.
  • Q10: What is the best spawning method?
    Cloning is the easiest for beginners.

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. SpawnA. Remove an object
2. CloneB. Create an object
3. DeleteC. A copy of a sprite
4. PoolD. Reuse objects

(Answers: 1-B, 2-C, 3-A, 4-D)

🎭 Scenario-based Exercise

Scenario: A student wants to create a game where enemies appear (spawn) at random positions and chase the player. When the enemies are caught, they disappear and new ones spawn.

Question: How would you implement this spawning system?

πŸ‘₯ Group Activity

In groups of 4, each person creates a different spawning system – one with random timing, one with random positions, one with waves, and one with object pooling.

✍️ Individual Activity

Create a simple spawning system that spawns objects every 3 seconds. Save your project.

πŸ› οΈ Mini Project

Create a game with a spawning system – falling stars, enemies, or items. Use random positions and timing, and delete objects when needed.

πŸ“‹ Practical Assignment

Create a game with a spawning system. Write a reflection on how you managed the objects.

πŸ”‘ Key Takeaways

  • Spawning systems create objects dynamically.
  • Cloning is the easiest way to spawn.
  • Timing controls how often objects appear.
  • Random creates variety.
  • Delete clones to keep performance.
  • Object pooling reuses objects.

πŸ’¬ Classroom Discussion Questions

  • What is the most important part of a spawning system?
  • How can you make spawning more interesting?
  • Why is deleting objects important?
  • What other games use spawning systems?

πŸ”œ Preparation for Module 7

In Module 7, we will explore Physics and Motion Systems. You will learn how to add gravity, velocity, and collision physics to your games.

Think about a game where characters jump or objects fall – we will learn how to make them move realistically!


You have completed Module 6 – you can now spawn and manage objects! πŸŽ‰

8

Module Seven

Module 7: Physics and Motion Systems

πŸ“˜ Module 7: Physics and Motion Systems

β€œMaking your games move like the real world.”

🌟 Module Introduction

In Modules 1-6, we learned about lists, custom blocks, game states, enemy AI, and spawning systems. Now it's time to learn about physics – how objects move and interact in the real world.

Physics makes games feel realistic. When a character jumps, it goes up and then comes down. When a ball is thrown, it follows an arc. These are all physics.

In this module, we will learn how to add gravity, velocity, acceleration, collision detection, and bounce physics to your games.

Let's make your games move like the real world!

🎯 Learning Objectives

  • Understand basic physics concepts: gravity, velocity, acceleration.
  • Implement gravity in your games.
  • Use velocity and acceleration for smooth motion.
  • Implement collision detection and response.
  • Create arc trajectories for projectiles.
  • Add bounce physics.

πŸ“– Warm-up Story: The Jumping Hero

Imagine a game where a hero jumps from platform to platform. When the hero jumps, they go up and then come back down. This is gravity at work.

When the hero throws a ball, it follows an arc – up and then down. This is projectile motion.

In this module, we will learn how to create these realistic movements in Scratch. Let's make your games feel real!

πŸ“š Main Lessons

Lesson 1: What is Physics in Games?

Definition: Physics in games is the simulation of real-world motion – gravity, velocity, and collisions.

Why important: Physics makes games realistic and fun.

Simple explanation: It's like making your game obey the laws of physics – things fall, bounce, and move realistically.

Real-life example: A ball falling to the ground.

School example: A pendulum swinging.

Home example: A toy car rolling down a ramp.

Nigerian example: A mango falling from a tree.

    Physics in Games:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Gravity β†’ pulls objects down              β”‚
    β”‚  Velocity β†’ speed and direction            β”‚
    β”‚  Acceleration β†’ changing speed             β”‚
    β”‚  Collision β†’ objects hitting each other    β”‚
    β”‚  Bounce β†’ objects bouncing back            β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Physics makes games realistic.

Lesson 2: Gravity – Pulling Objects Down

Definition: Gravity is a force that pulls objects down.

Why important: Gravity makes games feel realistic.

How to implement:

  • Use a variable called "gravity" (e.g., -0.5).
  • Use a variable called "yVelocity".
  • In a loop, change yVelocity by gravity.
  • Change y position by yVelocity.

Nigerian example: A character falls when they jump.

βœ… Mini summary: Gravity pulls objects down.

Lesson 3: Velocity – Speed and Direction

Definition: Velocity is speed in a specific direction.

Why important: Velocity controls how fast and where an object moves.

How to implement:

  • Use variables "xVelocity" and "yVelocity".
  • Change x position by xVelocity.
  • Change y position by yVelocity.

Nigerian example: A character moves left and right with velocity.

βœ… Mini summary: Velocity controls speed and direction.

Lesson 4: Acceleration – Changing Speed

Definition: Acceleration is the rate of change of velocity.

Why important: Acceleration creates smooth motion.

How to implement:

  • Add acceleration to velocity each frame.
  • Use "change xVelocity by xAcceleration".
  • Use "change yVelocity by yAcceleration".

Nigerian example: A car speeding up and slowing down.

βœ… Mini summary: Acceleration changes speed.

Lesson 5: Jumping with Gravity

Why important: Jumping is a core game mechanic.

Steps:

  1. Set yVelocity to a positive value (e.g., 10) when jumping.
  2. Apply gravity each frame.
  3. When y reaches the ground, stop falling.

Nigerian example: A character jumps and falls back down.

βœ… Mini summary: Jumping uses gravity to create a realistic arc.

Lesson 6: Collision Detection

Definition: Collision detection is checking if two objects are touching.

Why important: Collisions trigger events – like damage or collecting items.

How to detect:

  • Use "touching sprite" block.
  • Use "touching color" block.
  • Check distance between objects.

Nigerian example: A player collects a coin when touching it.

βœ… Mini summary: Collision detection checks if objects are touching.

Lesson 7: Collision Response

Definition: Collision response is what happens when objects collide.

Why important: Response makes collisions meaningful.

How to respond:

  • Bounce back.
  • Stop movement.
  • Destroy an object.
  • Change score.

Nigerian example: An enemy disappears when hit.

βœ… Mini summary: Collision response decides what happens when objects touch.

Lesson 8: Platformer Physics

Definition: Platformer physics is used in platform games – jumping, falling, and landing on platforms.

Why important: Platformers are one of the most popular game genres.

How to implement:

  • Apply gravity to the player.
  • Check if the player is on a platform.
  • Allow jumping when on the ground.

Nigerian example: A game where a character jumps between platforms.

βœ… Mini summary: Platformer physics creates jumping and landing.

Lesson 9: Projectile Motion – Arcs

Definition: Projectile motion is the path of an object thrown into the air.

Why important: Arcs are used for throwing, shooting, and jumping.

How to implement:

  • Set an initial velocity.
  • Apply gravity each frame.
  • The object follows a parabolic arc.

Nigerian example: A ball thrown in a game follows an arc.

βœ… Mini summary: Projectile motion creates arcs.

Lesson 10: Bounce Physics

Definition: Bounce physics makes objects bounce when they hit the ground.

Why important: Bouncing is common in games – balls, enemies, and players.

How to implement:

  • Reverse velocity when hitting the ground.
  • Reduce velocity slightly for realism (damping).

Nigerian example: A ball bounces on the ground.

βœ… Mini summary: Bounce physics makes objects bounce.

Lesson 11: Friction and Damping

Definition: Friction slows objects down. Damping reduces bounce height.

Why important: Friction and damping make motion more realistic.

How to implement:

  • Multiply velocity by a friction factor (e.g., 0.9).
  • Multiply bounce velocity by a damping factor (e.g., 0.8).

Nigerian example: A ball stops rolling due to friction.

βœ… Mini summary: Friction and damping make motion realistic.

Lesson 12: Combining Physics with Other Concepts

Why important: Physics works with AI, spawning, and game states.

Example:

  • Enemies use physics to chase the player.
  • Objects spawn and fall with gravity.
  • Game states control when physics is active.

Nigerian example: A complete game with realistic physics.

βœ… Mini summary: Combine physics with other concepts for powerful games.

πŸ“Œ Key Vocabulary

Physics – Real-world motion simulation.
Gravity – Pulls objects down.
Velocity – Speed and direction.
Acceleration – Changing speed.
Collision – Objects touching.
Projectile – Object thrown in an arc.
Bounce – Rebounds.
Damping – Reduces bounce height.
Friction – Slows objects down.
Platformer – A game with jumping.

🧠 Important Concepts

  • Realism: Physics makes games feel real.
  • Smoothness: Velocity and acceleration create smooth motion.
  • Interactivity: Collisions make games interactive.

πŸ”’ Steps to Perform Key Tasks

Task 1: Add Gravity to a Sprite

  1. Create variables: "yVelocity" and "gravity".
  2. Set gravity to -0.5.
  3. In a loop, change yVelocity by gravity.
  4. Change y position by yVelocity.
  5. Test it.

Task 2: Make a Sprite Jump

  1. When space is pressed, set yVelocity to 10.
  2. Apply gravity each frame.
  3. When y < -180, set yVelocity to 0.
  4. Test it.

Task 3: Create a Bouncing Ball

  1. Create variables: "xVelocity" and "yVelocity".
  2. Set initial velocities.
  3. Move with velocity.
  4. When hitting the edge, reverse velocity.
  5. Test it.
βœ… Mini summary: Follow these steps to implement physics.

πŸ”’ Step-by-step: Creating a Jumping Character

  1. Add a player sprite – choose a character.
  2. Create variables – "yVelocity", "gravity" (-0.5).
  3. Add "when green flag clicked" – start the game.
  4. Add "forever" loop – update physics.
  5. Add "change yVelocity by gravity" – apply gravity.
  6. Add "change y by yVelocity" – move the character.
  7. Add "when space pressed" – set yVelocity to 10.
  8. Add ground collision – if y < -180, set yVelocity to 0.
  9. Test your game – press space to jump.

🧸 Fun Examples for Children

  • Pet game: Make a pet jump and bounce.
  • Space game: Add gravity to spaceships.

🏠 Everyday Examples

  • Family game: A platformer game for family.
  • School project: A physics simulation.

πŸ‘ͺ Parent Tips

  • Show your child how gravity works in games.
  • Help them understand velocity and acceleration.
  • Encourage them to experiment with different physics values.

πŸ’‘ Interesting Facts

  • Physics engines are used in almost every game.
  • Scratch does not have a built-in physics engine.
  • You can create simple physics with just a few blocks.

❓ Did You Know?

  • Some games have complex physics engines.
  • Physics can be used for particles, cloth, and water.

πŸ”” Remember This

  • Gravity pulls objects down.
  • Velocity controls speed and direction.
  • Acceleration changes speed.
  • Collisions trigger events.
  • Physics makes games realistic.

⚠️ Common Mistakes

  • Gravity too strong. – Adjust values.
  • Forgetting to reset velocity. – Reset when on the ground.
  • No collision response. – Add response to collisions.
  • Objects moving through each other. – Use better collision detection.

βœ… Best Practices

  • Start with simple gravity.
  • Use variables for velocity and gravity.
  • Test physics values carefully.
  • Add collision detection.
  • Add damping for realism.
  • Combine physics with other concepts.

πŸ“Š Comparison: With vs Without Physics

Without PhysicsWith Physics
Objects move in straight linesObjects move realistically
No gravityGravity pulls objects down
No bouncingObjects bounce
UnrealisticRealistic

πŸ“ End-of-Module Summary

Great work! You have learned about physics and motion:

  • Gravity: Pulls objects down.
  • Velocity: Speed and direction.
  • Acceleration: Changing speed.
  • Collisions: Detection and response.
  • Projectiles: Arcs.
  • Bounce: Rebounds.
  • Damping: Reduces bounce height.

Your games will now feel realistic and responsive!

❓ Frequently Asked Questions

  • Q1: What is gravity?
    Pulls objects down.
  • Q2: What is velocity?
    Speed and direction.
  • Q3: What is acceleration?
    Changing speed.
  • Q4: How do I detect collisions?
    Use "touching" blocks.
  • Q5: What is a projectile?
    An object thrown in an arc.
  • Q6: How do I make objects bounce?
    Reverse velocity on collision.
  • Q7: What is damping?
    Reduces bounce height.
  • Q8: What is friction?
    Slows objects down.
  • Q9: How do I implement jumping?
    Set velocity, apply gravity.
  • Q10: Why is physics important?
    It makes games realistic.

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. GravityA. Speed and direction
2. VelocityB. Pulls objects down
3. CollisionC. Objects touching
4. BounceD. Rebound

(Answers: 1-B, 2-A, 3-C, 4-D)

🎭 Scenario-based Exercise

Scenario: A student wants to create a platformer game with jumping, gravity, and bouncing enemies.

Question: How would you implement the physics for this game?

πŸ‘₯ Group Activity

In groups of 4, each person creates a different physics system – one for gravity, one for bouncing, one for projectiles, and one for platformer physics.

✍️ Individual Activity

Create a simple game with gravity and jumping. Save your project.

πŸ› οΈ Mini Project

Create a platformer game with jumping, gravity, and collision detection. Add at least one platform.

πŸ“‹ Practical Assignment

Create a game that uses physics (gravity, velocity, collision). Write a reflection on how you implemented the physics.

πŸ”‘ Key Takeaways

  • Gravity pulls objects down.
  • Velocity controls speed and direction.
  • Acceleration changes speed.
  • Collisions trigger events.
  • Physics makes games realistic.
  • Implement physics with variables and loops.

πŸ’¬ Classroom Discussion Questions

  • What is the most important physics concept?
  • How can you make jumping feel more realistic?
  • What other games use physics?
  • How can you combine physics with AI?

πŸ”œ Preparation for Module 8

In Module 8, we will explore Scratch Extensions. You will learn how to use pen, music, video sensing, and text-to-speech extensions.

Think about a project that could use pen or video sensing – we will learn how to use them!


You have completed Module 7 – your games now have realistic physics! πŸŽ‰

9

Module Eight

Module 8: Scratch Extensions

πŸ“˜ Module 8: Scratch Extensions

β€œExpanding your creative toolbox.”

🌟 Module Introduction

In Modules 1-7, we learned a lot about Scratch – lists, custom blocks, game states, AI, spawning, and physics. But did you know that Scratch has extensions that add new features?

Extensions are like extra tools for your toolbox. They let you do things that are not possible with the standard blocks – like drawing with a pen, making music, controlling a robot, or using your camera.

In this module, we will explore some of the most useful Scratch extensions: the Pen, Music, Video Sensing, and Text-to-Speech extensions.

Let's expand your creative toolbox!

🎯 Learning Objectives

  • Understand what Scratch extensions are and how to use them.
  • Use the Pen extension to draw and create graphics.
  • Use the Music extension to create melodies and beats.
  • Use the Video Sensing extension for motion detection and camera interaction.
  • Use the Text-to-Speech extension to add spoken words.
  • Explore other extensions like Micro:bit and LEGO (if available).

πŸ“– Warm-up Story: The Creative Coder

Imagine you are a creative coder in Lagos. You want to create a project that draws beautiful patterns, plays music, and responds to your hand movements. But you don't know how to do it in Scratch.

Then you discover Scratch Extensions! You add the Pen extension to draw patterns, the Music extension to play melodies, and the Video Sensing extension to control the project with your hand.

Your project becomes interactive and magical. This is the power of extensions!

πŸ“š Main Lessons

Lesson 1: What Are Scratch Extensions?

Definition: Extensions are add-ons that give Scratch new features.

Why important: Extensions let you do things that are not possible with standard blocks.

Simple explanation: It's like adding new tools to your toolbox.

Real-life example: A carpenter adding a new saw to their toolbox.

School example: A student using a calculator for math.

Home example: A chef using a new kitchen gadget.

Nigerian example: A tailor using a new sewing machine attachment.

    Scratch Extensions:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Pen β†’ draw and create graphics            β”‚
    β”‚  Music β†’ play melodies and beats           β”‚
    β”‚  Video Sensing β†’ camera interaction        β”‚
    β”‚  Text-to-Speech β†’ spoken words             β”‚
    β”‚  Micro:bit β†’ control robots                β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Extensions add new features to Scratch.

Lesson 2: How to Add an Extension

Why important: You need to know how to add extensions.

How to add:

  • Click the "Add Extension" button at the bottom left.
  • Choose the extension you want.
  • It will appear in the blocks palette.

Nigerian example: A student adds the Pen extension to draw patterns.

βœ… Mini summary: Click "Add Extension" to add new features.

Lesson 3: The Pen Extension – Drawing with Code

Definition: The Pen extension lets you draw on the stage.

Why important: You can create graphics, patterns, and art.

Key blocks:

  • pen down: Start drawing.
  • pen up: Stop drawing.
  • set pen "summary-box">βœ… Mini summary: The Pen extension lets you draw on the stage.

Lesson 4: Drawing Shapes with the Pen

Why important: You can create geometric shapes and patterns.

Steps:

  1. Add the Pen extension.
  2. Use "pen down" to start.
  3. Use motion blocks to move the sprite.
  4. Use "pen up" to stop.
  5. Experiment with different shapes.

Nigerian example: A student draws a square, triangle, and circle.

βœ… Mini summary: Draw shapes by moving a sprite with the pen down.

Lesson 5: Creating Patterns with the Pen

Why important: Patterns are beautiful and fun to create.

How to create:

  • Use loops to repeat movements.
  • Change pen color or size each time.
  • Create complex designs.

Nigerian example: A student creates a colorful mandala pattern.

βœ… Mini summary: Use loops and color changes to create patterns.

Lesson 6: The Music Extension – Making Music

Definition: The Music extension lets you play musical notes and create melodies.

Why important: You can add music to your projects.

Key blocks:

  • play note 60 for 0.5 beats: Play a single note.
  • set instrument to: Change the instrument.
  • rest for 0.5 beats: Pause.

Nigerian example: A student plays a simple melody.

βœ… Mini summary: The Music extension lets you play musical notes.

Lesson 7: Creating a Melody

Why important: Melodies make projects more engaging.

Steps:

  1. Add the Music extension.
  2. Use "play note" blocks in sequence.
  3. Add "rest" blocks for pauses.
  4. Change instruments for variety.

Nigerian example: A student plays a Nigerian nursery rhyme.

βœ… Mini summary: Create melodies by sequencing notes.

Lesson 8: The Video Sensing Extension – Camera Interaction

Definition: The Video Sensing extension lets you use your camera to interact with projects.

Why important: You can control projects with your movements.

Key blocks:

  • video on: Turn on the camera.
  • video motion: Get motion data.
  • direction of video motion: Get motion direction.

Nigerian example: A student controls a game by waving their hand.

βœ… Mini summary: Video Sensing lets you use your camera.

Lesson 9: Creating a Motion-Controlled Game

Why important: Motion-controlled games are fun and interactive.

Steps:

  1. Add the Video Sensing extension.
  2. Turn on the video.
  3. Get video motion data.
  4. Use motion to move a sprite.

Nigerian example: A game where a character moves left and right with hand movements.

βœ… Mini summary: Use video motion to control sprites.

Lesson 10: The Text-to-Speech Extension – Spoken Words

Definition: The Text-to-Speech extension reads text aloud.

Why important: You can add voice to your projects.

Key blocks:

  • speak "Hello": Reads the text.
  • set voice to: Changes the voice.

Nigerian example: A project says "Welcome to Nigeria!".

βœ… Mini summary: Text-to-Speech reads text aloud.

Lesson 11: Combining Extensions

Why important: Extensions can be combined for amazing projects.

Example:

  • Pen + Music: Draw patterns while playing music.
  • Video Sensing + Text-to-Speech: Speak when motion is detected.

Nigerian example: A project that draws patterns and plays music when you wave your hand.

βœ… Mini summary: Combine extensions for creative projects.

Lesson 12: Exploring Other Extensions

  • Micro:bit: Control physical devices.
  • LEGO Mindstorms: Control LEGO robots.
  • Makey Makey: Use everyday objects as controllers.

Nigerian example: A student uses a Micro:bit to control a Scratch project.

βœ… Mini summary: Explore other extensions for physical computing.

πŸ“Œ Key Vocabulary

Extension – An add-on for new features.
Pen – Drawing extension.
Music – Sound and music extension.
Video Sensing – Camera interaction.
Text-to-Speech – Reads text aloud.
Micro:bit – Physical computing.
LEGO – Robot control.
Melody – A sequence of notes.
Motion – Movement detection.
Pattern – Repeated design.

🧠 Important Concepts

  • Creativity: Extensions unlock new creative possibilities.
  • Interactivity: Video Sensing and Text-to-Speech make projects interactive.
  • Integration: Combine extensions for powerful projects.

πŸ”’ Steps to Perform Key Tasks

Task 1: Draw a Square with the Pen

  1. Add the Pen extension.
  2. Add "when green flag clicked".
  3. Add "pen down".
  4. Repeat 4 times: move 100 steps, turn 90 degrees.
  5. Add "pen up".
  6. Test it.

Task 2: Play a Melody

  1. Add the Music extension.
  2. Add "when green flag clicked".
  3. Add "set instrument to piano".
  4. Add "play note 60 for 0.5 beats".
  5. Add "play note 62 for 0.5 beats".
  6. Add "play note 64 for 1 beat".
  7. Test it.

Task 3: Use Video Sensing

  1. Add the Video Sensing extension.
  2. Add "when green flag clicked".
  3. Add "turn video on".
  4. Add "forever" loop.
  5. Add "if video motion > 10".
  6. Add "say Motion detected!".
  7. Test it.
βœ… Mini summary: Follow these steps to use extensions.

πŸ”’ Step-by-step: Creating a Pen Pattern

  1. Add the Pen extension – click "Add Extension".
  2. Add "when green flag clicked" – start the project.
  3. Add "clear" – clear any previous drawings.
  4. Add "pen down" – start drawing.
  5. Add "set pen color" – choose a color.
  6. Add a "repeat" loop – repeat 36 times.
  7. Inside the loop – move 100 steps, turn 10 degrees.
  8. Change pen color – each iteration.
  9. Add "pen up" – stop drawing.
  10. Test your pattern – click the green flag.

🧸 Fun Examples for Children

  • Pet game: Draw a pet with the Pen extension.
  • Music game: Play a melody with the Music extension.

🏠 Everyday Examples

  • Family game: Create a motion-controlled game.
  • School project: Add voice to a presentation.

πŸ‘ͺ Parent Tips

  • Show your child how to add extensions.
  • Encourage them to experiment with different extensions.
  • Help them combine extensions for creative projects.

πŸ’‘ Interesting Facts

  • Scratch has over 20 extensions.
  • Extensions are developed by the Scratch Team and community.
  • Extensions make Scratch more powerful.

❓ Did You Know?

  • You can use the Pen extension to create animations.
  • The Music extension can play chords.

πŸ”” Remember This

  • Extensions add new features.
  • Pen draws on the stage.
  • Music plays notes.
  • Video Sensing uses the camera.
  • Text-to-Speech reads text aloud.
  • Combine extensions for creative projects.

⚠️ Common Mistakes

  • Forgetting to add the extension. – Always add the extension first.
  • Not clearing the stage. – Use "clear" before drawing.
  • Not turning on video. – Use "turn video on".
  • Music notes too fast. – Use longer beats.

βœ… Best Practices

  • Add the extension before using its blocks.
  • Use "clear" before drawing with the Pen.
  • Turn on video before using Video Sensing.
  • Test your code after adding extensions.
  • Combine extensions for creative projects.

πŸ“Š Comparison: Extensions

ExtensionWhat It DoesUse
PenDraws on the stageArt, patterns
MusicPlays musical notesMelodies, sounds
Video SensingUses cameraMotion control
Text-to-SpeechReads text aloudVoice, narration

πŸ“ End-of-Module Summary

Great work! You have learned about Scratch extensions:

  • Pen: Draw and create graphics.
  • Music: Play melodies and beats.
  • Video Sensing: Use the camera for interaction.
  • Text-to-Speech: Add spoken words.
  • Combining: Use multiple extensions together.
  • Exploring: Try Micro:bit, LEGO, and others.

You can now create projects with advanced features!

❓ Frequently Asked Questions

  • Q1: What are Scratch extensions?
    Add-ons for new features.
  • Q2: How do I add an extension?
    Click "Add Extension".
  • Q3: What does the Pen extension do?
    Draws on the stage.
  • Q4: What does the Music extension do?
    Plays musical notes.
  • Q5: What does Video Sensing do?
    Uses the camera for interaction.
  • Q6: What does Text-to-Speech do?
    Reads text aloud.
  • Q7: Can I combine extensions?
    Yes – combine them for creative projects.
  • Q8: What other extensions are there?
    Micro:bit, LEGO, Makey Makey.
  • Q9: Are extensions free?
    Yes – all extensions are free.
  • Q10: Can I create my own extension?
    Yes – but that's advanced.

πŸ”— Matching Exercise

Match the extension with its description.

ExtensionDescription
1. PenA. Reads text aloud
2. MusicB. Draws on the stage
3. Video SensingC. Plays musical notes
4. Text-to-SpeechD. Uses the camera

(Answers: 1-B, 2-C, 3-D, 4-A)

🎭 Scenario-based Exercise

Scenario: A student wants to create a project that draws a rainbow pattern, plays music, and responds to hand movements.

Question: What extensions would you use? How would you combine them?

πŸ‘₯ Group Activity

In groups of 4, each person explores a different extension and creates a small project. Share your projects with the group.

✍️ Individual Activity

Create a project that uses at least one extension. Save your project.

πŸ› οΈ Mini Project

Create a project that uses the Pen extension to draw a colorful pattern. Add music using the Music extension.

πŸ“‹ Practical Assignment

Create a project that uses an extension of your choice. Write a reflection on how the extension helped your project.

πŸ”‘ Key Takeaways

  • Extensions add new features to Scratch.
  • Pen draws on the stage.
  • Music plays notes.
  • Video Sensing uses the camera.
  • Text-to-Speech reads text aloud.
  • Combine extensions for creative projects.

πŸ’¬ Classroom Discussion Questions

  • What is your favorite extension and why?
  • How can you combine extensions creatively?
  • What other extensions would you like to see?
  • How can extensions make projects more interactive?

πŸ”œ Preparation for Module 9

In Module 9, we will explore Game Design and Polish. You will learn how to make your games look and feel professional.

Think about a game you have created – how can you make it look better and be more fun to play?


You have completed Module 8 – you can now use Scratch extensions! πŸŽ‰

10

Module Nine

Module 9: Game Design and Polish

πŸ“˜ Module 9: Game Design and Polish

β€œMaking your games look and feel professional.”

🌟 Module Introduction

In Modules 1-8, we learned how to build games with lists, custom blocks, game states, AI, spawning, physics, and extensions. But there is one more step – polish.

Polish is what makes a game feel complete and professional. It's the difference between a game that looks homemade and one that looks like it was made by a pro.

In this module, we will learn how to add polish to your games – sound effects, visual feedback, user interfaces, difficulty balancing, and playtesting. Let's make your games shine!

🎯 Learning Objectives

  • Understand the principles of good game design.
  • Add sound effects and background music.
  • Provide visual feedback for player actions.
  • Balance difficulty for fun gameplay.
  • Design user interfaces (score, health bars, menus).
  • Conduct playtesting and get feedback.

πŸ“– Warm-up Story: The Polished Game

Imagine two games. Game A is fun but has no sound, no visual effects, and a confusing interface. Game B has exciting sounds, cool effects, and a clear interface. Which game would you rather play?

Game B is polished. It feels professional and complete. In this module, we will learn how to make your games like Game B.

πŸ“š Main Lessons

Lesson 1: Principles of Good Game Design

Definition: Game design is the art of creating fun and engaging experiences.

Why important: Good design makes games enjoyable.

Simple explanation: It's like designing a playground – it should be fun and safe.

Key principles:

  • Fun: The game should be enjoyable.
  • Challenge: It should be challenging but not impossible.
  • Feedback: Players should know what's happening.
  • Clarity: The rules and goals should be clear.
  • Reward: Players should feel rewarded for their efforts.

Nigerian example: A game about Lagos should be fun, clear, and rewarding.

    Good Game Design:
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Fun β†’ keep players engaged                β”‚
    β”‚  Challenge β†’ not too easy, not too hard    β”‚
    β”‚  Feedback β†’ show what's happening          β”‚
    β”‚  Clarity β†’ clear rules and goals           β”‚
    β”‚  Reward β†’ feel good when you win           β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: Good design makes games fun and engaging.

Lesson 2: Sound Effects – Adding Audio Feedback

Definition: Sound effects are short audio clips that provide feedback.

Why important: Sound makes games more immersive.

How to add:

  • Use "start sound" blocks.
  • Add sounds for scoring, jumping, collecting, and losing.

Nigerian example: A game plays a cheer sound when you score.

βœ… Mini summary: Sound effects provide feedback and make games immersive.

Lesson 3: Background Music – Setting the Mood

Definition: Background music plays continuously during the game.

Why important: Music sets the mood and keeps players engaged.

How to add:

  • Use "start sound" in a loop.
  • Choose music that matches the game's mood.

Nigerian example: A game plays upbeat Afrobeats music.

βœ… Mini summary: Background music sets the mood.

Lesson 4: Visual Feedback – Showing What Happens

Definition: Visual feedback shows players what is happening.

Why important: Feedback helps players understand the game.

How to add:

  • Change sprite colors or sizes.
  • Show text messages.
  • Use particle effects (clones).

Nigerian example: A sprite flashes when hit.

βœ… Mini summary: Visual feedback helps players understand what's happening.

Lesson 5: User Interface – Score, Health, and Menus

Definition: UI shows information like score, lives, and menus.

Why important: UI helps players understand the game state.

How to design:

  • Show score and lives on the stage.
  • Use "say" or "think" blocks for messages.
  • Create buttons with sprites.

Nigerian example: A game shows "Score: 10" and "Lives: 3".

βœ… Mini summary: UI shows players important information.

Lesson 6: Health Bars – Showing Player Status

Definition: A health bar shows how much health the player has.

Why important: Health bars help players know when they are in danger.

How to create:

  • Use a sprite that changes size based on health.
  • Change the color from green to red.

Nigerian example: A game has a health bar that decreases when hit.

βœ… Mini summary: Health bars show player status.

Lesson 7: Difficulty Balancing – Making It Fun

Definition: Difficulty balancing means making the game challenging but not too hard.

Why important: Balanced games keep players engaged.

How to balance:

  • Start easy and gradually increase difficulty.
  • Adjust enemy speed, spawn rate, and health.
  • Test with different players.

Nigerian example: A game gets harder as the player's score increases.

βœ… Mini summary: Balanced games are challenging but not impossible.

Lesson 8: Progression – Levels and Difficulty

Definition: Progression means the game gets harder over time.

Why important: Progression keeps players interested.

How to implement:

  • Add levels with increasing difficulty.
  • Increase enemy speed or spawn rate.
  • Add new obstacles.

Nigerian example: A game has 5 levels with increasing difficulty.

βœ… Mini summary: Progression keeps games interesting.

Lesson 9: Polish – Small Details That Make a Big Difference

Definition: Polish is the small details that make a game feel complete.

Why important: Polish makes games look professional.

Examples:

  • Title screen.
  • Instructions.
  • Game over screen.
  • High score board.
  • Particle effects.

Nigerian example: A game has a custom title screen and instructions.

βœ… Mini summary: Polish makes games look professional.

Lesson 10: Playtesting – Getting Feedback

Definition: Playtesting means having others play your game and give feedback.

Why important: Playtesting helps you find problems and improve.

How to conduct:

  • Ask friends or family to play.
  • Watch them play and note problems.
  • Ask for honest feedback.
  • Use feedback to improve.

Nigerian example: A student asks classmates to play and provide feedback.

βœ… Mini summary: Playtesting helps you improve your game.

Lesson 11: Iterative Improvement

Definition: Iterative improvement means making small changes and testing again.

Why important: Iteration leads to better games.

Steps:

  1. Make a change.
  2. Test it.
  3. Get feedback.
  4. Repeat.

Nigerian example: A student improves their game based on feedback.

βœ… Mini summary: Iteration makes games better.

Lesson 12: Final Polish – Releasing Your Game

Why important: A polished game is more enjoyable and shareable.

Final steps:

  • Add a title screen.
  • Add instructions.
  • Add a high score board.
  • Share your game.

Nigerian example: A student shares their polished game on Scratch.

βœ… Mini summary: Polish your game before sharing it.

πŸ“Œ Key Vocabulary

Polish – Small details that make a game professional.
Feedback – Visual or audio responses.
UI – User interface.
Health bar – Shows player health.
Balancing – Adjusting difficulty.
Progression – Increasing difficulty.
Playtesting – Testing with players.
Iteration – Making improvements.
Title screen – The first screen.
Instructions – How to play.

🧠 Important Concepts

  • Polish: Details make a big difference.
  • Feedback: Players need to know what's happening.
  • Iteration: Keep improving.

πŸ”’ Steps to Perform Key Tasks

Task 1: Add a Sound Effect

  1. Choose a sound from the library.
  2. Add "start sound" block.
  3. Place it where feedback is needed.

Task 2: Add a Health Bar

  1. Create a sprite for the health bar.
  2. Use "set size to health * 10".
  3. Change color based on health.

Task 3: Conduct a Playtest

  1. Ask a friend to play your game.
  2. Watch and take notes.
  3. Ask for feedback.
  4. Make improvements.
βœ… Mini summary: Follow these steps to polish your game.

πŸ”’ Step-by-step: Polishing Your Game

  1. Add sound effects – for scoring and losing.
  2. Add background music – set the mood.
  3. Add visual feedback – flash or change size.
  4. Create a UI – show score and lives.
  5. Add a health bar – show player status.
  6. Balance difficulty – adjust enemy speed.
  7. Add a title screen – and instructions.
  8. Conduct playtesting – get feedback.
  9. Iterate – make improvements.
  10. Share your game – with the world.

🧸 Fun Examples for Children

  • Pet game: Add a health bar for your pet.
  • Space game: Add sound effects for shooting and explosions.

🏠 Everyday Examples

  • Family game: Polish a game for family game night.
  • School project: Add polish to a school project.

πŸ‘ͺ Parent Tips

  • Show your child how polish makes games better.
  • Encourage them to add sound and visual effects.
  • Help them conduct playtesting with friends.

πŸ’‘ Interesting Facts

  • Polish can make a game 10x more enjoyable.
  • Professional games spend months on polish.
  • Players notice small details.

❓ Did You Know?

  • Sound effects can be created with Scratch's built-in sounds.
  • You can use the "pen" extension to create health bars.

πŸ”” Remember This

  • Polish makes games professional.
  • Sound and visual feedback are important.
  • UI helps players understand the game.
  • Difficulty balancing keeps games fun.
  • Playtesting helps you improve.
  • Iteration makes games better.

⚠️ Common Mistakes

  • No sound. – Add sound effects.
  • No visual feedback. – Show what's happening.
  • Too easy or too hard. – Balance difficulty.
  • No instructions. – Tell players how to play.
  • No playtesting. – Get feedback.

βœ… Best Practices

  • Add sound effects for feedback.
  • Add visual feedback for actions.
  • Show score and lives on screen.
  • Balance difficulty for fun.
  • Add a title screen and instructions.
  • Conduct playtesting.
  • Iterate and improve.

πŸ“Š Comparison: Unpolished vs Polished Game

UnpolishedPolished
No soundSound effects and music
No visual feedbackVisual effects
No UIScore, lives, health bar
No title screenTitle screen and instructions
No playtestingPlaytested and improved

πŸ“ End-of-Module Summary

Great work! You have learned about game design and polish:

  • Sound: Add sound effects and music.
  • Visual feedback: Show what's happening.
  • UI: Display score, lives, and health.
  • Balancing: Make the game challenging but fun.
  • Progression: Increase difficulty over time.
  • Playtesting: Get feedback and improve.

Your games are now polished and professional!

❓ Frequently Asked Questions

  • Q1: What is polish?
    Small details that make a game professional.
  • Q2: Why add sound effects?
    Sound provides feedback and immersion.
  • Q3: What is UI?
    User interface – shows information.
  • Q4: What is a health bar?
    Shows player health.
  • Q5: How do I balance difficulty?
    Adjust speed, spawn rate, and health.
  • Q6: What is playtesting?
    Having others play and give feedback.
  • Q7: Why is playtesting important?
    It helps you find problems.
  • Q8: What is iteration?
    Making improvements over time.
  • Q9: What should a title screen include?
    Game name and start button.
  • Q10: How can I make my game more fun?
    Add polish, balance difficulty, and get feedback.

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. PolishA. Having others play your game
2. PlaytestingB. Small details that make a game professional
3. UIC. Shows information to the player
4. BalancingD. Adjusting difficulty

(Answers: 1-B, 2-A, 3-C, 4-D)

🎭 Scenario-based Exercise

Scenario: A student has created a game but it feels unfinished. There is no sound, no visual feedback, and the difficulty is too easy.

Question: How would you polish this game?

πŸ‘₯ Group Activity

In groups of 4, each person takes a different aspect of polish – one adds sound, one adds visual effects, one designs the UI, and one balances difficulty. Combine them into one game.

✍️ Individual Activity

Identify three things you can polish in a game you have created. Make the improvements and save your project.

πŸ› οΈ Mini Project

Take a game you have created and polish it. Add sound effects, visual feedback, a UI, and a title screen. Share your polished game.

πŸ“‹ Practical Assignment

Conduct a playtest of your game with at least 2 people. Write a reflection on the feedback and what you improved.

πŸ”‘ Key Takeaways

  • Polish makes games professional.
  • Sound and visual feedback are important.
  • UI helps players understand the game.
  • Balancing difficulty keeps games fun.
  • Playtesting helps you improve.
  • Iteration makes games better.

πŸ’¬ Classroom Discussion Questions

  • What is the most important part of polish?
  • How can sound improve a game?
  • Why is playtesting important?
  • What would you add to a game to make it more fun?

πŸ”œ Preparation for Module 10

In Module 10, we will complete the course with Capstone Project – Complete Game Development. You will use everything you've learned to create a complete, polished game.

Think about a game you want to create – we will plan, build, and polish it in the next module!


You have completed Module 9 – your games are now polished! πŸŽ‰

11

Module Ten

Module 10: Capstone Project – Complete Game Development

πŸ“˜ Module 10: Capstone Project – Complete Game Development

β€œPutting everything together to create your masterpiece.”

🌟 Module Introduction

Congratulations! You have reached the final module of the Certified Scratch Expert Level 2 course. You have learned so much – lists, custom blocks, game states, AI, spawning, physics, extensions, and polish.

Now it's time to put it all together. In this capstone module, you will plan, create, and finalize a complete, polished game from start to finish.

Think of this as your "final exam" – but it's fun! You will use all the skills you learned to create something you can be proud of. You will be a Certified Scratch Expert Level 2!

Let's create your masterpiece!

🎯 Learning Objectives

  • Plan a complete game project from start to finish.
  • Apply all the skills learned in the course.
  • Create a polished, playable game.
  • Test, debug, and improve your game.
  • Share your game with the world.
  • Reflect on your learning journey.

πŸ“– Warm-up Story: The Game Developer

Imagine you are a young game developer in Nigeria. You have been learning Scratch for months, and now you are ready to create your own complete game.

You plan your game – a platformer with enemies, power-ups, and multiple levels. You use lists for high scores, custom blocks for actions, game states for flow, AI for enemies, spawning for objects, physics for jumping, and extensions for polish.

You test your game, get feedback, and improve it. Finally, you share it on Scratch. People play your game and love it. You feel proud of what you created.

This is your capstone project – your chance to create something amazing!

πŸ“š Main Lessons

Lesson 1: What is a Capstone Project?

Definition: A capstone project is a final project that shows everything you have learned.

Why important: It demonstrates your skills and gives you a portfolio piece.

Simple explanation: It's like a final exam – but instead of a test, you create a game.

Real-life example: A student creates a game for a coding competition.

School example: A final project for a computer class.

Home example: A game you share with your family.

Nigerian example: A young coder creates a game about Nigerian culture.

    Capstone Project = Showcase of Skills
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Planning β†’ Creating β†’ Testing β†’ Sharing    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
βœ… Mini summary: A capstone project showcases everything you have learned.

Lesson 2: Choosing Your Game Idea

Why important: The right idea motivates you and shows your skills.

Ideas for games:

  • Platformer: A character jumps between platforms.
  • Clicker: Click on objects to score.
  • Maze: Navigate a character through a maze.
  • Quiz: Answer questions to score.
  • Space shooter: Shoot enemies in space.
  • Racing: Race against time or opponents.
  • Adventure: Explore and collect items.

Nigerian example: A student creates a game about Nigerian wildlife.

βœ… Mini summary: Choose a game idea that excites you.

Lesson 3: Planning Your Game – The Game Design Document

Definition: A game design document (GDD) is a written plan for your game.

Why important: A GDD keeps you organized and focused.

What to include:

  • Title: What is your game called?
  • Goal: What is the player trying to do?
  • Characters: What sprites will you use?
  • Setting: What backdrop will you use?
  • Controls: How does the player control the game?
  • Scoring: How does the player score?
  • Lives: How many lives does the player have?
  • Levels: How many levels?
  • Enemies: What enemies will you have?
  • Power-ups: What special items will you have?
  • End condition: When does the game end?

Nigerian example: A student writes a GDD for a game about Lagos.

βœ… Mini summary: A game design document plans your game.

Lesson 4: Setting Up Your Project

Why important: A clean project makes coding easier.

Steps:

  • Create a new Scratch project.
  • Name it clearly (e.g., "MyGame_v1").
  • Organize sprites and backdrops.
  • Create variables and lists.
  • Create custom blocks.

Nigerian example: A student creates a project called "Lagos Adventure".

βœ… Mini summary: Set up your project before coding.

Lesson 5: Building Core Mechanics

Why important: Core mechanics are what make your game work.

How to build:

  • Movement: Use motion blocks and keyboard controls.
  • Jumping: Use gravity and velocity.
  • Scoring: Use variables.
  • Lives: Use variables.
  • Game states: Use a gameState variable.

Nigerian example: A student builds a character that moves and jumps.

βœ… Mini summary: Core mechanics are the foundation of your game.

Lesson 6: Adding Advanced Features

Why important: Advanced features make your game more exciting.

What to add:

  • AI: Enemies that chase and patrol.
  • Spawning: Enemies and items appear dynamically.
  • Physics: Gravity, velocity, and collisions.
  • Lists: High scores and inventory.
  • Custom blocks: Reusable code.

Nigerian example: A game uses cloning to spawn enemies.

βœ… Mini summary: Advanced features add depth to your game.

Lesson 7: Adding Polish

Why important: Polish makes your game look professional.

What to add:

  • Sound effects and background music.
  • Visual feedback (flashing, size changes).
  • UI (score, lives, health bar).
  • Title screen and instructions.
  • Game over screen.

Nigerian example: A game adds Afrobeats music.

βœ… Mini summary: Polish makes your game complete.

Lesson 8: Testing and Debugging

Definition: Testing means playing your game to find problems. Debugging means fixing them.

Why important: Testing makes your game better.

How to test:

  • Play your game many times.
  • Ask friends to play and give feedback.
  • Check for bugs – things that don't work.
  • Fix any issues you find.

Nigerian example: A student tests their game with classmates.

βœ… Mini summary: Testing and debugging make your game polished.

Lesson 9: Playtesting and Feedback

Definition: Playtesting is having others play your game and give feedback.

Why important: Playtesting helps you see what you missed.

How to conduct:

  • Ask friends, family, or classmates to play.
  • Watch them play and note problems.
  • Ask for honest feedback.
  • Use feedback to improve.

Nigerian example: A student asks classmates for feedback.

βœ… Mini summary: Playtesting helps you improve your game.

Lesson 10: Final Polish

Why important: Final polish makes your game ready to share.

Steps:

  1. Fix any remaining bugs.
  2. Add a title screen.
  3. Add instructions.
  4. Add a high score board.
  5. Make sure everything works smoothly.

Nigerian example: A student adds a title screen with the game name.

βœ… Mini summary: Final polish makes your game ready to share.

Lesson 11: Sharing Your Game

Why important: Sharing lets others play and enjoy your game.

How to share:

  • Save your project online.
  • Click "Share" on Scratch.
  • Share the link with friends and family.
  • Share on social media.
  • Get more feedback and keep improving.

Nigerian example: A student shares their game on the Scratch website.

βœ… Mini summary: Share your game and let others enjoy it.

Lesson 12: Reflecting on Your Learning Journey

Why important: Reflection helps you see how far you have come.

Questions to ask:

  • What did I learn in Level 2?
  • What was the hardest part?
  • What am I most proud of?
  • What would I do differently next time?
  • What's next for me?

Nigerian example: A student writes a reflection on their coding journey.

βœ… Mini summary: Reflection helps you appreciate your growth.

πŸ“Œ Key Vocabulary

Capstone – A final project showing your skills.
GDD – Game Design Document.
Mechanics – The rules and systems of a game.
Polish – Making a game look professional.
Playtesting – Having others play and give feedback.
Debug – Fixing mistakes in code.
Title screen – The first screen of a game.
Instructions – How to play the game.
Game Over – End of game screen.
Portfolio – A collection of your work.

🧠 Important Concepts

  • Planning: A good plan leads to a good game.
  • Practice: The more you code, the better you get.
  • Feedback: Learning from others helps you grow.

πŸ”’ Steps to Perform Key Tasks

Task 1: Plan Your Capstone Game

  1. Choose your game idea.
  2. Write a Game Design Document.
  3. List the sprites and backdrops you will use.
  4. Plan the scoring and end condition.
  5. Set a timeline for completion.

Task 2: Create Your Game

  1. Open Scratch and start a new project.
  2. Add your sprites and backdrops.
  3. Program the core mechanics.
  4. Add advanced features.
  5. Add polish (sound, UI, title screen).
  6. Test and debug.

Task 3: Share Your Game

  1. Save your project online.
  2. Click "Share".
  3. Copy the link and share with friends.
  4. Ask for feedback.
  5. Improve your game based on feedback.
βœ… Mini summary: Follow these steps to create and share your capstone game.

πŸ”’ Step-by-step: Creating Your Capstone Game

  1. Choose your idea – pick a game you want to create.
  2. Write a GDD – plan your game.
  3. Set up – create a new Scratch project.
  4. Add sprites – choose or create your characters.
  5. Add backdrop – choose your setting.
  6. Program core mechanics – movement, jumping, scoring.
  7. Add advanced features – AI, spawning, physics.
  8. Add polish – sound, UI, title screen.
  9. Test and debug – play and fix issues.
  10. Conduct playtesting – get feedback.
  11. Final polish – make it perfect.
  12. Share – share your game with the world.
  13. Reflect – think about what you learned.

🧸 Fun Examples for Children

  • Pet game: Create a game where you take care of a pet.
  • Space game: Create a game where you fly a spaceship and avoid obstacles.

🏠 Everyday Examples

  • Family game: Make a game for your family to play together.
  • School project: Create a game for a school assignment.

πŸ‘ͺ Parent Tips

  • Encourage your child to plan their game before coding.
  • Help them test their game and give constructive feedback.
  • Celebrate their finished game – they worked hard!

πŸ’‘ Interesting Facts

  • Many professional game developers started with Scratch.
  • Your capstone game can be added to your portfolio.
  • Sharing your game can lead to new opportunities.

❓ Did You Know?

  • Scratch games have been played millions of times.
  • You can remix other people's games to learn.

πŸ”” Remember This

  • Plan your game before coding.
  • Use all the skills you learned.
  • Test and debug your game.
  • Get feedback and improve.
  • Share your game with the world.
  • Be proud of what you created.

⚠️ Common Mistakes

  • "I'll skip planning." – Planning saves time – do it.
  • "I won't test my game." – Testing finds problems.
  • "I'll ignore feedback." – Feedback helps you improve.
  • "I won't share my game." – Sharing lets others enjoy it.

βœ… Best Practices

  • Plan your game thoroughly.
  • Use clear, organized code.
  • Test your game often.
  • Get feedback and improve.
  • Polish your game before sharing.
  • Share your game with pride.
  • Reflect on your learning.

πŸ“Š Comparison: Good vs Great Game

Good GameGreat Game
Basic mechanicsPolished mechanics
No soundSound and music
No instructionsClear instructions
BugsBug-free
Not sharedShared and played

πŸ“ End-of-Module Summary

Congratulations! You have completed the capstone module:

  • Capstone game: A final project showcasing your skills.
  • Planning: Choose and plan your game.
  • Creating: Use all your coding skills.
  • Testing: Find and fix bugs.
  • Improving: Use feedback to make it better.
  • Sharing: Let others play your game.
  • Reflection: Think about your journey.

You are now a Certified Scratch Expert Level 2 – go create amazing games!

❓ Frequently Asked Questions

  • Q1: What is a capstone project?
    A final project showing your skills.
  • Q2: How long should my game be?
    1-3 minutes of playtime is good.
  • Q3: Can I get help with my game?
    Yes – ask teachers, friends, or use Scratch forums.
  • Q4: What if I make a mistake?
    That's okay – learn from it and improve.
  • Q5: How do I share my game?
    Click "Share" on Scratch and share the link.
  • Q6: Can I work with a team?
    Yes – collaboration is a great skill.
  • Q7: What if my game has bugs?
    Debug them – that's part of coding.
  • Q8: How do I get feedback?
    Share your game and ask for comments.
  • Q9: What's next after this course?
    Keep coding, build more games, and try advanced languages.
  • Q10: What is the most important thing I learned?
    You can create anything with coding!

πŸ”— Matching Exercise

Match the term with its description.

TermDescription
1. CapstoneA. Fixing mistakes
2. DebugB. A final project
3. PolishC. Making a game look professional
4. GDDD. A game design document

(Answers: 1-B, 2-A, 3-C, 4-D)

🎭 Scenario-based Exercise

Scenario: You have been asked to create a game for your school's open day. The game should be fun, easy to learn, and showcase your skills.

Question: What game would you create? How would you plan, create, and share it?

πŸ‘₯ Group Activity

In groups of 4, share your capstone game plans. Give each other feedback and suggestions for improvement.

✍️ Individual Activity

Write a Game Design Document for your capstone game. Include the title, goal, characters, controls, scoring, and end condition.

πŸ› οΈ Mini Project

Create your capstone game. Use all the skills you learned in the course. Share your game with the class.

πŸ“‹ Practical Assignment

Complete your capstone game. Write a reflection on your process – what you learned, what was challenging, and what you are proud of.

πŸ”‘ Key Takeaways

  • Your capstone game shows your skills.
  • Planning is essential for a good game.
  • Use all the coding skills you learned.
  • Test, debug, and improve your game.
  • Share your game and get feedback.
  • Reflect on your growth.
  • Keep coding and creating.

πŸ’¬ Classroom Discussion Questions

  • What is the most important thing you learned in this course?
  • What was the most challenging part?
  • What game are you most proud of?
  • What will you create next?

🏁 Congratulations – You've Completed the Entire Course!

You have completed all ten modules of the Certified Scratch Expert Level 2 course. You have learned:

  • Module 1: Review and Foundations
  • Module 2: Lists – Advanced Data Management
  • Module 3: Custom Blocks – Reusable Code
  • Module 4: Game States and Structured Game Flow
  • Module 5: Enemy Behaviors and Simple AI
  • Module 6: Spawning Systems and Object Management
  • Module 7: Physics and Motion Systems
  • Module 8: Scratch Extensions
  • Module 9: Game Design and Polish
  • Module 10: Capstone Project

You are now a Certified Scratch Expert Level 2 – ready to create amazing games and share them with the world.

πŸŽ‰ You are a Scratch Master! πŸŽ‰


Thank you for your dedication – go create something amazing!

πŸ† Get Certified

πŸ”’

Earn this certificate

Every lesson is already free to read. Sign up, pass the exam, and unlock Practice Tools plus a verified certificate with your name on it β€” ₦4,000/month.

πŸŽ“ Sign Up & Unlock for ₦4,000/month
πŸ› οΈ Practice Tools
Hands-on simulators & labs - subscription required.
β†’
🎯 Internship Tasks
Real-world tasks to build your portfolio - try them free for 7 days, no card required.
β†’