top of page

Making Coding Fun: Engaging Scratch Projects for Teachers and Students

Code and Create a Balloon Popping Game using Scratch

Engaging students with interactive and creative coding projects is a fantastic way to develop their problem-solving skills. In this blog post, we will guide teachers and students through the process of creating a Balloon Popping game using Scratch. This project introduces video sensing and fundamental coding concepts to enhance interactivity and fun!


Coding in Scratch
Coding in Scratch

Watch the Ultimate full version here: https://youtu.be/LeXsVKFv7gU?si=0jjvH-nKrUYqkxdv


Overview of the Project

In this project, students will learn how to:

  • Create a new project in Scratch.

  • Enable video sensing.

  • Add and manipulate Sprites.

  • Use event-driven programming.

  • Implement sound and motion effects.

  • Randomize sprite positions to enhance gameplay.

Each section below corresponds to a video lesson. Video placeholders are provided where the videos should be inserted.


Find the full Ultimate Version here:


Lesson 1: Setting Up Your Scratch Project

Lesson 1 - Setting up your Scratch Project

Steps to Follow:

  1. Create a New Project

    • Log into your Scratch account.

    • Click on Create in the top left corner, or go to My Stuff and start a new project.

    • Rename your project to something meaningful.

  2. Adjust Your Workspace

    • Use the fullscreen and layout options to customize your screen for better visibility.

  3. Enable Video Sensing

    • Go to the Extensions menu (bottom-left corner) and select Video Sensing.

    • Grant camera access when prompted.

  4. Add a Balloon Sprite

    • Delete the default cat Sprite.

    • Click the magnifying glass in the Sprites panel and search for Balloon.

    • Position the Balloon where you’d like it to appear.

  5. Start with an Event

    • Drag the When Green Flag Clicked block from the Events category.

    • Ensure the balloon appears by adding the Show block from the Looks category.

  6. Implement Video Motion Detection

    • Drag the When video motion > 10 block from the Video Sensing category.

    • Add a Play Sound (Pop) block from the Sound category to simulate the balloon pop.

  7. Make the Balloon Disappear

    • Use the Hide block after the pop sound.

  8. Randomize Balloon Position

    • Wait 1 second before repositioning the balloon using Go to Random Position.

    • Use the Show block to make it reappear.

  9. Test Your Game!

    • Run the game by clicking the green flag and interact using hand movements


Lesson 2: Adding Variables for Scoring and Timers

Lesson 2: Adding Variables for Scoring and Timers

Steps to Follow:

  1. Create Two Variables: Score and Timer

    • Go to the Variables section and click Make a Variable.

    • Name the first variable Score and apply it to all Sprites.

    • Create a second variable Timer, also applying it to all Sprites.

    • Move and resize the Timer variable for better visibility.

  2. Set Initial Values for Variables

    • Add a When Green Flag Clicked block.

    • Use Set Score to 0 and Set Timer to 30 (or another starting number).

  3. Increase the Score When the Balloon Pops

    • Add Change Score by 1 after the pop sound in the existing event sequence.

  4. Implement a Countdown Timer

    • Use a Forever loop initially, then replace it with a Repeat Until Timer = 0 loop.

    • Add Wait 1 Second followed by Change Timer by -1.

    • Stop the game when the timer reaches zero using the Stop All command.

  5. Debugging: Preventing Negative Timer Values

    • Modify the loop so that the game stops precisely at zero.

  6. Adding Background Music

    • Choose a looping sound effect (e.g., Hip Hop) from the Sounds section.

    • Use Play Sound Until Done inside a Forever loop.

  7. Creating a Game Over Screen

    • Create a new Sprite and add text that says "Game Over".

    • Initially Hide the Game Over Sprite.

    • Use Broadcast Game Over when the timer reaches zero.

    • When Game Over is received, show the Game Over screen and stop all scripts.


Lesson 3: Debugging and Adding Educational Elements

Lesson 3: Debugging and Adding Educational Elements

Steps to Follow:

  1. Fixing the Video Bug

    • Ensure the video sensing stops when the game is over by adding Turn Video Off when the Game Over screen appears.

    • At the start of the game, add Turn Video On to reset it.

  2. Adding Facts to Enhance Learning

    • Create a new Sprite for a fact display.

    • Use the Text Tool in the Sprite Editor to type an educational fact.

    • Position the fact on the screen and format it for readability.

  3. Showing the Fact at the Right Time

    • Hide the fact Sprite when the game starts.

    • Use an If Statement to display the fact when the Timer reaches a certain value (e.g., 27 seconds).

    • Use Broadcast Message to trigger the fact display.

    • Ensure the fact disappears after a few seconds.

  4. Testing the Fact Mechanic

    • Play the game to confirm that the fact appears at the correct time and disappears appropriately.

  5. Looking Ahead: Adding a Quiz

    • In the next lesson, we will add a quiz question at the end of the game to test player knowledge and reward correct answers with extra points


Lesson 4: Adding a Quiz at the End

Lesson 4: Adding a Quiz at the End

Steps to Follow:

  1. Asking a Question at the End of the Game

    • Modify the Game Over screen script to ask a question before displaying the game over message.

    • Use the Ask and Wait command from the Sensing category.

  2. Checking the Player's Answer

    • Use an If-Then-Else block to compare the player's answer with the correct answer.

    • If the answer is correct, increase the score by 5 points and play a cheer sound.

    • If incorrect, subtract 5 points and play an oops sound.

  3. Adding Sounds for Feedback

    • Add two new sounds: a positive sound (cheer) and a negative sound (oops).

    • Assign appropriate sounds based on whether the player answers correctly or incorrectly.

  4. Finalizing the Game Over Screen

    • After answering the question, display the Game Over screen.

    • Wait 3 seconds before stopping the game.


Lesson 5: Adding More Facts and Questions

Lesson 5: Adding More Facts and Questions

Steps to Follow:

  1. Duplicate the Fact Sprite

    • Copy the existing fact Sprite and update its text to a new fact.

    • Adjust the code to ensure each fact appears at different times.

  2. Add Corresponding Quiz Questions

    • Modify the Game Over screen script to include a new quiz question.

    • Use the same logic to compare answers and award points accordingly.

  3. Refine Your Game

    • Continue adding facts and quiz questions.

    • Test and debug any errors that may arise.


Final Thoughts

Now that your game includes multiple facts and questions, you can refine it further. How many facts and questions can you include? What other features can enhance the experience?

By the end of this series, students will have created an interactive game that responds to motion, making learning both fun and engaging!


Watch the Ultimate version


The ultimate guide to building a game in Scratch


 

Kommentare

Mit 0 von 5 Sternen bewertet.
Noch keine Ratings

Rating hinzufügen
Featured Posts
Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
  • White YouTube Icon
  • White LinkedIn Icon

© Copyright 2017 by AtTech Edu Limited

March, Cambridgeshire, UK

Registered Company with Companies House - 10735007

Created by Richard Poth with wix.com

Twitter : @richtheteach | Email: poth.r@attechedu.com

bottom of page