Introduction – Hurdle Jumping Game in Scratch
Are you ready to create your very own hurdle jumping game in Scratch—just like the iconic Chrome Dino or Super Mario? 🎮 Whether you’re new to Scratch or just looking for your next fun project, this step-by-step tutorial will guide you through building an exciting runner-style game complete with jumping mechanics, moving obstacles, a scoring system, game over detection, and a victory screen.
👉 Watch the full video tutorial here: YouTube – Epic Jumping Sprite Over Hurdles Game | Fun Gameplay! by Kodex Academy
Omaansh Aggarwal from Kodex Academy walks you through every part of the game—from sprite setup to game over logic.
Using Scratch’s simple drag-and-drop interface, you’ll learn how to:
- Animate a jumping sprite (Pico) over moving hurdles,
- Detect collisions with obstacles,
- Track and display your score,
- Play coin sound effects when scoring,
- Trigger a “You Win” screen when the player reaches a target score,
- And more!
This is a perfect Scratch game for beginners, kids learning to code, or anyone looking for fun Scratch project ideas. By the end of this tutorial, you’ll have a fully playable game that looks and feels just like the classics—but built entirely by you!
Setting Up Your Scratch Project
Deleting the Cat Sprite and Adding Pico
- Open a new Scratch project.
- Delete the default cat sprite.
- Click “Choose a Sprite,” search for Pico, and select it.
- Resize Pico to around 40–50%.
Choosing the Desert Backdrop
- Click the “Choose a Backdrop” icon.
- Search and select the Desert backdrop.
- Duplicate it twice and rename:
- One to Game Over
- One to You Win
Creating Game Over and You Win Screens
- Open the “Game Over” backdrop.
- Use the Text Tool to write “Game Over” (use red color).
- Do the same for “You Win” using a celebratory color and font.
Coding the Jumping Sprite in Scratch
Simple Jump Logic with Motion Blocks
Add this to the Pico sprite:
when [space v] key pressed
repeat 10
change y by 10
end
repeat 10
change y by -10
end
Pico now jumps whenever you press the space-bar!
Enhancing the Jump with Gravity (Optional Advanced Feature)
when green flag clicked
set [y-velocity v] to 0
forever
change y-velocity by -1
change y by (y-velocity)
if <key [space v] pressed?> and <touching [ground v]?> then
set [y-velocity v] to 15
end
end
This adds a realistic gravity effect for more advanced gameplay.
Adding Moving Hurdles (Rock Obstacles)
Animating Rock Movement with Glide Blocks
- Add a rock sprite and resize it to 40.
- Name it Rock One and duplicate it as Rock Two.
Add this to both:
when green flag clicked
forever
go to x: 240 y: -160
glide 3 secs to x: -240 y: -160
end
Fixing Overlap with Timing and Visibility
For Rock Two, stagger its appearance:
when green flag clicked
hide
wait 1.5 seconds
show
Now, both rocks appear at different times.
Game Over Logic – Collision Detection in Scratch
For each rock sprite:
when green flag clicked
wait until <touching [Pico v]>
switch backdrop to [Game Over v]
stop all
Game over triggers when Pico hits any rock!
Creating a Score System in Scratch
Adding a Score Variable
- Go to Variables → Create variable:
score
- Reset the score when the game starts:
when green flag clicked
set [score v] to 0
Detecting Clean Jumps for Points
Inside Pico:
if <not <touching [Rock One v]> and not <touching [Rock Two v]>> then
change [score v] by 1
end
Playing Coin Sound on Scoring
- Go to the Sounds tab for Pico.
- Add a sound like Coin.
- In the code:
start sound [Coin v]
Now scoring plays a rewarding sound!
Win Condition – Creating the You Win Screen
Broadcasting Win Message
Inside Pico:
if <(score) = 5> then
broadcast [You Win v]
play sound [Victory v] until done
end
Playing a Celebration Sound
Choose a fun sound like “Victory” from the sound library and reduce the volume if needed.
Switching to the Final Backdrop
On the Stage:
when I receive [You Win v]
switch backdrop to [You Win v]
stop all
Final Gameplay Demo – Test Your Game
Now test everything in full-screen mode:
- Jump over rocks
- Earn points
- Hear coin sounds
- Win at score 5 or get Game Over
Enhancement Ideas to Take It Further
Add Gravity for Realistic Movement
As shown earlier—add vertical velocity and simulate falling.
Increase Difficulty Over Time
when green flag clicked
set [rockSpeed v] to 3
forever
wait 10 seconds
change [rockSpeed v] by 1
end
Adjust glide time dynamically using rockSpeed
.
Add Bonus Coins or Power-Ups
Create a coin sprite:
when green flag clicked
forever
wait (pick random 5 to 10) secs
go to x: 240 y: -100
show
wait 2 secs
hide
end
when Pico touches [Coin v]
change [score v] by 3
hide
Animate the Sprite with Costumes
when I receive [Jump v]
repeat 5
next costume
wait 0.1 seconds
end
Common Errors & Debugging Tips
- Sprite not jumping? Double-check motion blocks and repeat counts.
- Score not increasing? Ensure “if not touching rocks” is used.
- Rocks not moving? Make sure the glide blocks are inside a forever loop.
- Win screen not showing? Check if broadcast and backdrops are set up properly.
Final Thoughts – A Great Scratch Project for Beginners
This game combines the core fundamentals of Scratch coding for kids with fun, creativity, and challenge. You’ve learned:
- How to use motion and control blocks
- How to add variables and score logic
- How to play sounds and change backdrops
- How to build a runner game in Scratch that mimics popular platforms
Encourage kids to remix the project by:
- Changing the sprite
- Using different backdrops
- Adding more obstacles or themes
Call to Action
- Don’t forget to check out the full video tutorial by Kodex Academy here: Epic Jumping Sprite Over Hurdles Game | Fun Gameplay! By Omaansh Aggarwal – Kodex Academy
- Like, comment & share the video
- Visit kodexacademy.com
- subscribe to the Kodex Academy YouTube channel for deeper Scratch content.
Happy coding with Kodex Academy! 🚀
Learn More with Kodex Academy
At Kodex Academy, we’re passionate about helping students learn coding in creative ways. This project teaches more than Scratch—it empowers young minds to build tools that work in the real world.
Explore more:
Stay updated with new content, free tutorials, and coding challenges!
- 🌐 Website: https://kodexacademy.com
- 🌐 Website: https://games.kodexacademy.com
- 💬 WhatsApp Channel: Join Now
- 💼 LinkedIn: Kodex Academy
- 📸 Instagram: @kodex_academy
- 𝕏 Twitter: @Kodex_Academy
- 📢 Telegram: Join Our Channel
- 🔗 Patreon: patreon.com/KodexAcademy
Further Reading & Links
- Scratch Wiki Motion Blocks: https://en.scratch-wiki.info/wiki/Motion_Blocks
- Scratch Programming for Beginners: https://scratch.mit.edu/projects/editor
- Scratch Animation Guide: https://en.scratch-wiki.info/wiki/Animating