Skip to content

Your First Interactive Game

Ready to create your very first game in Scratch? We’ll build “Catch the Falling Stars” - a fun, complete game that teaches essential game development concepts while being engaging to play!

Catch the Falling Stars is a simple but addictive game where:

  • ⭐ Stars fall from the sky
  • 🎯 Players move a basket to catch them
  • 🏆 Score increases with each caught star
  • ⚡ Game gets faster as score increases
  • 💥 Game ends when players miss too many stars

Before we start coding, let’s plan our game like professional developers:

🎭 Characters (Sprites)

Player Basket: Moves left and right to catch stars
Falling Star: Falls from top, gives points when caught
Game Controller: Manages score, lives, and game rules

🎬 Game Mechanics

Movement: Arrow keys control the basket
Collision: Stars disappear when touching basket
Scoring: +10 points per star caught
Difficulty: Stars fall faster as score increases

🎨 Visual Design

Background: Night sky with stars
UI Elements: Score display, lives counter
Effects: Star sparkles, sound feedback
Polish: Smooth animations and transitions

🎵 Audio Design

Catch Sound: Pleasant chime when catching stars
Miss Sound: Gentle notification when missing
Background Music: Optional ambient space music
Game Over: Distinctive end-game sound

Let’s start by creating our game environment:

  1. 🎨 Choose Your Backdrop Go to the Stage and click the backdrop icon. Choose “Space” or “Night” backdrop, or create your own starry sky.

  2. 🗑️ Remove the Default Cat Right-click on Scratch Cat and select “delete” - we don’t need it for this game.

  3. 🎯 Add the Player Basket Click the sprite icon and search for “basket” or draw a simple rectangular basket using the paint editor.

  4. ⭐ Add a Falling Star Add a star sprite from the library, or draw your own yellow star shape.

  5. 📺 Create Game Variables Make these variables for all sprites:

    • score (visible on stage)
    • lives (visible on stage)
    • star_speed (hidden - controls difficulty)
    • game_running (hidden - tracks game state)

Step 2: Programming the Player Basket 🧺

Section titled “Step 2: Programming the Player Basket 🧺”

The basket is our player character - it needs to respond to keyboard input:

when green flag clicked
set [game_running ▼] to (1)
go to x:(0) y:(-150)
forever
if <(game_running) = (1)> then
if <key (left arrow ▼) pressed?> then
change x by (-5)
end
if <key (right arrow ▼) pressed?> then
change x by (5)
end
// Keep basket on screen
if <(x position) < (-220)> then
set x to (-220)
end
if <(x position) > (220)> then
set x to (220)
end
end
end
when green flag clicked
forever
if <(game_running) = (1)> then
go to x:(mouse x) y:(-150)
// Keep within screen bounds
if <(x position) < (-220)> then
set x to (-220)
end
if <(x position) > (220)> then
set x to (220)
end
end
end

Stars need to fall from the top and reset when they hit the bottom:

when green flag clicked
set [star_speed ▼] to (2)
hide
forever
if <(game_running) = (1)> then
// Start at random position at top
go to x:(pick random (-220) to (220)) y:(180)
show
// Fall down at current speed
repeat until <(y position) < (-180)>
change y by (0 - (star_speed))
// Check if caught by basket
if <touching (Basket ▼)?> then
change [score ▼] by (10)
play sound (collect ▼) until done
// Increase difficulty slightly
change [star_speed ▼] by (0.1)
// Reset star position
go to x:(pick random (-220) to (220)) y:(180)
end
wait (0.02) seconds
end
// Star hit ground - lose a life
change [lives ▼] by (-1)
play sound (miss ▼) until done
// Check for game over
if <(lives) ≤ (0)> then
set [game_running ▼] to (0)
hide
say [Game Over!] for (3) seconds
stop [all ▼]
end
hide
wait (pick random (0.5) to (2)) seconds
end
end

Step 4: Game Initialization and Management 🎮

Section titled “Step 4: Game Initialization and Management 🎮”

Create a game controller sprite (invisible) to manage the overall game:

when green flag clicked
set [score ▼] to (0)
set [lives ▼] to (3)
set [star_speed ▼] to (2)
set [game_running ▼] to (1)
// Display instructions
say [Use arrow keys to catch falling stars!] for (3) seconds
say [Don't let them hit the ground!] for (2) seconds
say [Get ready...] for (2) seconds
// Start the game loop
broadcast (start game ▼)
when green flag clicked
forever
if <(game_running) = (1)> then
// Change difficulty based on score
if <(score) > (50)> then
set [star_speed ▼] to (4)
end
if <(score) > (100)> then
set [star_speed ▼] to (6)
end
if <(score) > (200)> then
set [star_speed ▼] to (8)
end
end
wait (1) seconds
end

Professional games feel great because of small details:

when I receive (star caught ▼)
repeat (5)
change [color ▼] effect by (25)
change size by (20)
wait (0.1) seconds
change size by (-20)
wait (0.1) seconds
end
clear graphic effects
when I receive (game over ▼)
repeat (3)
change [brightness ▼] effect by (50)
wait (0.2) seconds
change [brightness ▼] effect by (-50)
wait (0.2) seconds
end
when I receive (star caught ▼)
repeat (2)
change size by (10)
wait (0.1) seconds
change size by (-10)
wait (0.1) seconds
end

Take your game to the next level with these enhancements:

Add special golden stars that give bonus points or temporary abilities:

// Golden Star (rare)
if <(pick random (1) to (20)) = (1)> then
set [color ▼] effect to (50) // Make it golden
when caught:
change [score ▼] by (50)
set [star_speed ▼] to (1) // Slow down for 5 seconds
wait (5) seconds
set [star_speed ▼] to (normal speed)

Professional developers spend lots of time testing. Here’s how to test your game:

  1. 🎯 Test Basic Functionality

    • Does the basket move smoothly?
    • Do stars fall at the right speed?
    • Does collision detection work reliably?
  2. ⚖️ Check Game Balance

    • Is it too easy or too hard?
    • Does difficulty increase appropriately?
    • Are the controls responsive enough?
  3. 🐛 Find and Fix Bugs

    • Can the basket go off-screen?
    • Do variables reset properly between games?
    • Are there any timing issues?
  4. ✨ Polish the Experience

    • Add sound effects for all interactions
    • Ensure visual feedback for all actions
    • Test with friends and family for feedback

Once your basic game works well, try these advanced additions:

🌟 Multiple Star Types

Different colored stars worth different points, or stars that move in patterns instead of just falling straight.

🎭 Character Customization

Let players choose different basket designs or unlock new looks based on their score.

🏆 Achievement System

Awards for reaching certain scores, catching stars in a row, or playing for a certain amount of time.

🌍 Multiple Levels

Different backgrounds, star patterns, or gameplay mechanics as players progress.

This project teaches fundamental game development concepts:

  • Game Loop: The forever loop that updates everything continuously
  • Input Handling: Responding to player keyboard/mouse actions
  • Collision Detection: Detecting when objects touch each other
  • State Management: Using variables to track game status
  • Feedback: Every action should have a visible/audible response
  • Progressive Difficulty: Games should get harder gradually
  • Clear Goals: Players should always know what they’re trying to do
  • Fail State: Clear consequences help players learn and improve
  • Responsive Controls: Movement should feel immediate and accurate
  • Visual Clarity: Important elements should be easy to see
  • Audio Cues: Sound helps players understand what’s happening
  • Recovery: Players should be able to restart easily after game over

Ready to create more complex games?


Congratulations! You’ve built your first complete interactive game. This is just the beginning of your game development journey with Vibelf’s guidance! 🎮✨