If you’ve ever dreamed of designing your own video game but didn’t know where to start, you’re in the right place. With the help of Kodex Academy, building a complete Hide and Seek game in Scratch 3.0 has never been easier — or more fun!
Whether you’re a kid, teacher, or curious beginner, this step-by-step tutorial will walk you through everything from designing characters and environments to coding logic for movement, scoring, hiding, and winning. Scratch’s drag-and-drop interface is perfect for learning core programming skills, and this project is a brilliant way to sharpen your creativity and logic.
So fire up Scratch, open your imagination, and get ready to build a classic game with a digital twist. Let’s dive into exactly what this project entails, what you’ll learn, and why this is an ideal activity for aspiring coders of all ages.
What is Scratch 3.0?
Before diving into the project, let’s get familiar with the platform. Scratch 3.0 is a block-based visual programming language developed by the MIT Media Lab. It allows users to build interactive stories, animations, and games using drag-and-drop coding blocks — making it perfect for beginners, especially children aged 7–16.
What makes Scratch special is that it doesn’t just teach how to code — it teaches how to think like a coder. It emphasizes creativity, logical thinking, problem-solving, and experimentation.
And that’s where Kodex Academy comes in, with a carefully crafted game project that brings all these skills to life.
Why Choose the Hide and Seek Game?
There are thousands of Scratch tutorials out there, so what makes this project stand out? The Hide and Seek Game offered by Kodex Academy is not only fun and visually appealing, but it also introduces learners to fundamental coding concepts without feeling overwhelming.
This project provides a balanced mix of creative design and logical thinking. You’ll design characters, set up scenes, and then bring them to life with interactive gameplay. This project is ideal for classroom learning, after-school coding clubs, or even just a weekend hobby. You’ll not only build a game, but you’ll also understand the logic behind how it works.
And best of all, it’s highly customizable. Once you learn the basics, you can add your own characters, themes, and rules — making it your very own game.
To learn the basics of scratch block programming, you can check out the Kodex Academy video tutorial on YouTube here:
Hide and Seek Game in Scratch 3.0 – A Step-by-Step Breakdown
This tutorial is filled with valuable lessons. Here’s an overview of what you’ll learn by building your own Hide and Seek game in Scratch 3.0:
- How to set up a Hide and Seek game environment
- How to use backdrops, sprites, and costumes effectively
- How to code player controls and movement
- How to create hideable objects and add random hiding spots
- How to add a score system and win/lose conditions
- Tips for clean code using My Blocks (custom blocks)
- BONUS: How to enhance your game with sound effects and animations
1. How to Set Up a Hide and Seek Game Environment
Every good game begins with a scene. In Scratch, this means choosing a backdrop and designing the space where the game happens. This section guides you through selecting or creating a background that suits the Hide and Seek theme — like a character, a house, or a cityscape. You’ll also learn how to:
- Choose and import sprites from the Scratch library
- Position sprites (characters or objects)
- Adjust sizes and layers
- Customize the game stage
Code – Setting Up Hide and Seek Game Environment
To get started, open the Scratch editor. By default, it opens with the Scratch Cat sprite — we won’t need it for this project.
- Delete the Scratch Cat sprite by right-clicking it.
- Click on “Choose a Sprite” and search for “Gobo” — our alien character.
- Click on “Choose a Backdrop”, search for “Space”, and pick “Nebula” or any space-themed background. This gives our game a fun cosmic vibe!
Now we’re ready to bring Gobo to life with some code!
2. How to Code Player Score, Controls and Movement
Now it’s time to breathe life into your characters. This part teaches you how to code for score, sprite position, and visibility of the sprite. You’ll set it up step-by-step. You’ll also learn:
- How to use
if
conditions for keypress detection - Smooth sprite motion with the
move
andchange x/y by
blocks - Edge detection so sprites don’t run off the screen
Understanding event handling and coordinate-based movement are critical coding skills — and you’ll pick them up while having fun.
Code – Create a Score Variable
- Go to the Variables tab and click “Make a Variable.”
- Name it Score and click OK.
- The Score variable should now appear on the stage.
🟩 When Green Flag Clicked – Use this block to reset the game every time it starts:
When green flag clicked
Set [Score v] to (0)
Go to x: (0) y: (0)
Show
Say [Click me to get your score!] for (2) seconds
This block ensures that every time the game starts:
- Score resets to 0
- Gobo moves to the center of the screen
- Gobo appears and prompts the player to click
3. Creating Hideable Objects and Adding Random Hiding Spots
One of the coolest parts of this tutorial is coding random hiding locations for your sprites. Each time the game starts, hidden characters (like animals or boxes) appear in different spots — making it exciting and unpredictable. You’ll explore how to:
- Use the
go to x: y:
andpick random
blocks - Create variables for position control
- Hide and show sprites using
hide
andshow
blocks
This introduces key concepts like randomization and game state, which are used in professional game development too.
Code – Making Gobo Hide and Move Randomly
Now the real hide-and-seek begins! We’ll use a forever loop to keep Gobo hiding and reappearing at random spots.
Forever
Hide
Wait (1) seconds
Go to x: (pick random -200 to 200) y: (pick random -140 to 140)
Show
Wait (0.7) seconds
- The hide block makes Gobo disappear.
- It waits for 1 second (to add suspense).
- Then moves Gobo to a random position using the
pick random
operator. - It shows Gobo again, but only for 0.7 seconds — so be quick!
You can experiment with these timings to make the game harder or easier.
4. Adding a Score System and Win/Lose Conditions
No game is complete without feedback and goals. You’ll learn how to:
- Create a score variable
- Increase score when a hidden object is found
- Display score on the screen
- End the game after all objects are found or after a timer runs out
You’ll also use logic blocks to detect when the seeker is touching or overlapping a hidden sprite — and then play a sound, update the score, and make the object disappear.
Learning how to manage game conditions builds an understanding of control flow and decision-making in programming.
Code – Scoring Mechanism – Click to Catch!
Now we add interactivity. When you click on Gobo, your score should go up.
When this sprite clicked
Change [Score v] by (1)
Start sound [Zoop v]
- The score goes up by 1 every time Gobo is clicked.
- We play the “Zoop” sound to add a satisfying feedback effect.
To add a sound:
- Go to the Sounds tab
- Click Choose Sound and select “Zoop” or any fun sound you like.
5. Add Win/Lose Conditions (Optional)
While this wasn’t covered in the basic tutorial, you can make your game more challenging by adding win or lose conditions. For example:
- Win condition: Reach a score of 10.
- Lose condition: Miss Gobo a certain number of times.
Example block for win condition:
If <(Score) = 10>
Then
Broadcast [Win v]
Stop all
Then you can show a “You Win!” screen when the player reaches 10 points.
6. Tips for Clean Code Using My Blocks (Custom Blocks)
As your project grows, organizing your code becomes important. Scratch allows you to organize and modularize your code using “My Blocks” — which are similar to functions in text-based programming. You’ll create custom blocks like:
initializeGame (Setup Game)
checkIfFound
randomizeHiding (Move Gobo Randomly)
Update Score
This not only makes your code easier to read but also avoids repetition. This helps avoid messy scripts and makes your code easier to debug and understand. Kodex Academy emphasizes these good habits to help learners transition smoothly into more complex programming in the future. Watch this YouTube video to learn more about My Blocks in Scratch – My Blocks in Scratch Explained
To create a custom block:
- Go to My Blocks
- Click Make a Block
- Name it (e.g., “Setup Game”)
- Move relevant blocks into it
7. Bonus: Adding Sound Effects and Animations
Adding sounds, dialogue, and motion effects makes the game feel alive. Coding for this game also teaches you to add sound effects, music, and simple animations that make the game come alive. You’ll learn:
- How to use the Sound Library in Scratch
- Triggering sounds on events (like finding a hidden object)
- Using motion blocks and costume changes for animation effects
Adding these elements improves user experience and makes your game more engaging and rewarding.
Code – Sound Effects and Animations
- Add different sounds when you miss Gobo.
- Use “glide” blocks to make Gobo move smoothly.
- Add “costume changes” to show different facial expressions on Gobo.
- Use broadcast messages to create transitions between game states.
Animations can be created by switching costumes quickly or changing sprite size for a pop effect when clicked.
When this sprite clicked
Change size by (10)
Wait (0.1) seconds
Set size to (100)%
Recap and Tips for Customization
Now that your basic Hide and Seek game is running, try experimenting with the following:
- Change how long Gobo is visible — make it more challenging
- Modify the score system — give more points per click
- Swap in new characters and backdrops — make your own story
- Add background music using the “Sound” tab
- Use variables like “Lives” or “Level” to build progression
Final Thoughts
This Hide and Seek game is a fantastic project for young coders or beginners who want to learn interactive game development using Scratch. You’ve learned how to:
- Design a simple game interface
- Work with sprites and random movement
- Handle interactivity with mouse clicks
- Implement a scoring system
- Enhance gameplay with sound and visuals
The possibilities are endless once you understand the basics. Add timers, make Gobo faster, or add more aliens to seek!