Game Design Studio β€Ί Module 2: Make Your First Game Move!
Module 02

Make Your First Game Move! πŸ•ΉοΈ

Ever wonder how game characters jump, run, and collect coins? It’s not magic, it's logic! Today, we're using Scratch to build a game by snapping together colorful blocks, like digital LEGOs. Ready? Let's build.

🧩 What is Visual Programming?

Mini-Mission: Ready to code right now? Let's do it! ➑️ Click here to open Scratch and drag any block you want onto the screen. You just wrote your first line of code!

Think of coding like building with LEGOs. With "text" code, you have to type out every single instruction. With visual programming like Scratch, you snap colorful blocks together. If the blocks fit, the code works! It's a super-fast and fun way to see if your game idea works.

The 3 Core Block Types

🎩 Events (Hats)

The "green flag" that starts your code. They always go on top!

🧱 Actions (Stacks)

The blocks that *do* something, like `move`, `jump`, or `say hello!`.

πŸ—œοΈ Logic (C-Blocks)

The "brains" that repeat code or check `if` something is true.

🎬 Watch & Learn

Time for a lightning-fast tour! This video from the official Scratch team will show you the ropes in just a few minutes. Watch for the part where they add a soundβ€”it's super easy!

πŸ“ Builder's Notebook

Did you see how they used an if block? That's our secret weapon! What do you think we'll put inside the if block's diamond-shaped hole to check if a key is being pressed?

πŸ” The Forever Loop

Remember our Player β†’ Challenge β†’ Reward loop from Module 1? The Forever block is the engine that runs that loop, checking for your input and updating the game world over and over again.

In a real game, this loop runs dozens of times every second to check your controls and keep everything moving. In Scratch, the most powerful block is the Forever block. Without it, the computer reads your code once and stops. 😴 With it, the computer constantly checks for your button presses and updates the screen. It's the engine of your game!

A Scratch cat bouncing from side to side in a forever loop.

Pro Tip: This is the 'Frame Rate'! πŸ€“

When a game runs at 60 FPS (Frames Per Second), this is what it means! In Scratch, the forever loop runs about 30 times per second. That means if you have a `move 10 steps` block inside, your sprite moves 300 steps every second! (Try it!)

πŸ€” Curiosity Corner: How do the pros do this?

Advanced Peek: The `Update()` Function πŸ€–

In pro engines like Unity or Godot, the forever loop is called the Update() or _process() function. It's the game's heartbeat. Mastering the forever block means you're already learning one of the most important concepts in all of game development. This is what it looks like in real code:

function Update() {
          // This is the forever loop!
          if (input.is_key_pressed('right_arrow')) {
            player.move_right();
          }
        }

Pro Tip: In engines like Unity, there's another loop called FixedUpdate() that runs on a perfect, steady timer. It's used for physics so that a character's jump is the same height on a slow computer as it is on a fast one. The forever block in Scratch is smart and tries to do both at once!

πŸ› οΈ Logic Builder Challenge

Before jumping into the real Scratch editor, let's test your logic. Can you build a script for basic character movement?

Goal: Assemble the blocks in the correct order to make the character move right FOREVER when the right arrow is pressed. Click the blocks in the palette below to add them to the script area.

Block Palette (Click to add)

move 10 steps
forever
key [right arrow] pressed?
when 🟒 clicked
if <__> then

Your Script

Empty Script

πŸ›‘οΈ Safety Check: Playing Online

Scratch has a huge, friendly online community where you can share your games. But just like any playground, there are rules to keep everyone safe and having fun. Here's your checklist:

  • πŸ’– Be Kind, Always: Celebrate what other people build! High-five their cool ideas in the comments. Never be mean or share scary things.
  • 🀫 Keep Your Secrets Secret: Your online username is your cool secret identity! Never share your real name, address, school, or phone number.
  • πŸ“’ Tell a Grown-Up: If you see something weird or mean, or if anyone makes you feel uncomfortable, tell a parent or trusted adult right away. You are never in trouble for this β€” you're being a hero!
  • πŸ§‘β€πŸ€β€πŸ§‘ Browse with a Buddy: When looking at games made by others, it's always best to have a parent with you, especially at first. They're your co-pilot on this adventure!

πŸš€ Time to Build

You've mastered the logic. Now it's time to build for real. Head over to the official Scratch website with a parent to start your first project!

βœ… Your First Mission

Go to the Scratch Editor and recreate the movement script you built in our Logic Challenge. Can you also make the character move left when the left arrow key is pressed?

⚑ Juice it Up!

Add a new sprite, like a star to collect. When your character touches it, don't just add a point to the scoreβ€”make it feel awesome! Add a "pop" sound effect, make the character flash a different color for a second, and maybe even add a tiny "screen shake" effect by quickly moving the camera a few pixels. This is called "Game Feel" or "Juice" and it makes games way more fun!

☠️ Boss Challenge

The technique is 'parallax scrolling.' The trick is to move background layers at different speeds relative to the player's movement. Your mission: Create two background sprites. Inside your player's movement loop, when the right arrow is pressed, make the player move right, make the 'closer' background sprite move left by 2 steps, and make the 'distant' background sprite move left by 1 step. This difference in speed creates a powerful illusion of depth. See a master version here!

πŸ—ΊοΈ From Blocks to Brackets

You've crushed it! Mastering logic in Scratch is a huge first step. When you're ready for the next adventure, there are three awesome paths:

  • Build Bigger Games (No Code!): Ready to build games that work on a phone? Check out a tool like GDevelop. It uses a block-based system like Scratch but can make games you can share with friends on any device!
  • Start Typing Real Code: Take the next step in our AI Builders Lab track with Module 1: Your First Line of JavaScript. We'll take the exact same logic you learned today and build it with the language that powers the web. Get ready. { } ;
  • Dive into a Pro Engine: Ready for the deep end? Check out the Godot Engine. It's a free, professional tool used to make hit indie games. Its coding language, GDScript, is very beginner-friendly and the perfect next step after you master the JavaScript basics in our AI Builders Lab.

πŸ‘¨β€πŸ‘©β€πŸ‘§ Parent Corner: Creating Together

Scratch requires an email to create an account and save projects. This is a perfect step to do with your child! It’s a great chance to talk about choosing a fun, anonymous username and a strong password.

Conversation Starter: "Ask your parents about the first video game they ever played. How are the characters in your game different from the ones in their game?"

Go Deeper: If your child is mastering Scratch basics quickly, you can explore the world of Scratch "mods" like Turbowarp together. These tools add advanced features for kids who are ready to push the boundaries of block-based coding.

Complete the Logic Builder Challenge above to finish this module!