Game Over
Handle losing.
Game Over is a free Coding for Kids lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Coding for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Game Over! 💀
Ahoy, explorer! 🏴☠️ Not every choice ends in treasure. Sometimes... GAME OVER! 💀
Today we learn to handle LOSING in a fun, fair way! 🎮
print("Let's handle Game Over! 💀")A Wrong Choice ❌
If the player picks the wrong path, they lose! Use else! ❌
choice = "poke the dragon"
if choice == "run away":
print("You escape safely! 🏃")
else:
print("GAME OVER! 💀")Running Out of Health ❤️
If health drops to 0 or below, it's game over! 💔
health = 0
if health <= 0:
print("You ran out of health! 💔")
print("GAME OVER! 💀")A Dramatic Ending 🎬
Make the loss feel exciting, not sad! A little drama is fun! 🎬
print("The cave rumbles... 🪨")
print("Rocks fall everywhere! 🌋")
print("💀 GAME OVER 💀")Be Kind to the Player 🤗
Always be encouraging! Tell them to try again! 🤗
Losing is just a chance to learn! 🌱
print("Oh no, you lost! 💀")
print("But don't give up! Try again! 💪")Game Over ASCII Art 🪦
Let's draw a fun GAME OVER screen with symbols! 🪦
print("+-------------+")
print("| GAME OVER |")
print("| 💀 |")
print("+-------------+")Show the Score 📊
Even when losing, show how many coins they collected! 📊
It gives them a goal to beat next time! 🎯
coins = 20
print("GAME OVER! 💀")
print(f"You collected {coins} coins. 🪙")
print("Beat that next time! 🎯")Play Again? 🔁
Ask if the player wants to try again! 🔁
again = input("Play again? (yes/no) ")
if again == "yes":
print("Restarting the adventure! 🔄")
else:
print("Thanks for playing! 👋")A Game Over Function 🛠️
Put the game over screen in a function to reuse it anywhere! 🛠️
def game_over():
print("💀 GAME OVER 💀")
print("Try again, hero! 💪")
game_over()Win or Lose Together 🎲
A full game checks BOTH ending: win AND lose! 🎲
This is the heart of your whole adventure! ❤️
treasure = False
if treasure:
print("YOU WIN! 🏆")
else:
print("GAME OVER! 💀 Try again! 💪")Game Designer! 🏆
You built a complete adventure game! 🎉🎉
- Lose with
elseor low health ❌❤️ - Make endings dramatic but kind 🎬🤗
- Show the score and offer 'play again' 🔁
- Win AND lose paths complete the game! 🎲
You're a real game designer now! 💪
print("My adventure game is complete! 🎮🥇")Quick Check ✅
Last question of the course! You've got this! 🧠
Recap Time! 🎒
You finished the Treasure Hunt Adventure course! 🌟🎉
- Handle losing with
elseand health checks ❌❤️ - Make Game Over fun and encouraging 🎬🤗
- Show the score and offer 'play again' 🔁
- Win + lose = a complete game! 🎮
Amazing work, young game designer! 🚀
print("Treasure Hunt Adventure course done! 🎓🎮")Frequently asked questions
Is the “Game Over” lesson free?
Yes — the full text of “Game Over” is free to read here on the web, and the Coding for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Coding for Kids course, upgrade to CoddyKit PRO.
What will I learn in “Game Over”?
Handle losing. You practise Coding for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Coding for Kids?
No prior experience is required. Coding for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Game Over” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Coding for Kids lesson?
Yes. Every Coding for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.