Dojo Defender: Session 7
Today you decide what happens in Dojo Defender. No step-by-step instructions — pick a feature, plan it, and build it.
You start from the complete Dojo Defender with everything on it: ship, asteroids, 3 enemy types, waves, particles, parallax stars, and a final boss with 3 phases.
This is your game. Make something of it.
Choose what you want to build
Below are some ideas. Pick one — or come up with your own feature.
Easy
- Power-ups: enemies sometimes (20%) drop a power-up. Red = spread shot (3 bullets), green = shield, yellow = speed boost. Power-ups work for 5 seconds.
- Difficulty: make the game easier (more lives, slower enemies) or harder (fewer lives, faster spawns).
- Sound: add a power-up sound (
powerup.wav), a game-over sound, or background music that speeds up at higher waves.
Medium
- High score: save the highest score in a file (
highscore.txt). Show it on the menu and game-over screen. Only overwrite it if the new score is higher. - Difficulty scaling: make the game a bit harder every wave — faster enemies, smaller asteroids, more frequent spawning.
- Poison enemies: a new enemy type that leaves a trail of poisonous particles.
- Ship animation: the ship can only fire 3 bullets at a time. Load a “heat” indicator or add a cooldown.
Hard
- Second boss: make a new boss that appears in a different wave (e.g. wave 7). Different looks, different behaviour.
- Extending the power-up system: add a 4th power-up (e.g. “time freeze” — enemies freeze for 3 seconds).
- Combo system: the faster you kill enemies, the more points. A “combo multiplier” that goes up.
- Boss has its own power-up drops: the boss drops a rare power-up when it’s defeated.
Own idea
Got an idea of your own? Great. Discuss it briefly with a coach and start building.
Tips for planning your feature
Before you start writing code, answer these questions:
- What should the player see? (a new power-up, a text, an icon?)
- When does it happen? (when you press SPACE, when an enemy dies, when wave 10 starts?)
- How long does it last? (5 seconds? Permanent? Until the next wave?)
- What has to change in the code? (new variables? a new list? a timer?)
- How do I know it works? (what is the “check” — what do I have to see to know it’s finished?)
Write your answers on paper or in comments at the top of the file.
Cheatsheets from previous sessions
Can’t remember something anymore? Use the cheatsheets from previous sessions:
- Session 2: Ship and asteroids
- Session 3: Enemies and shooting
- Session 4: Restarting and resetting the game
- Session 5: Stars and particles
- Session 6: Boss fight
Coach-guided planning
You fill this part in together with a coach before you start coding.
My feature: _________________________________________________
I choose: Easy / Medium / Hard / Own idea
New variables I need:
- __________________________________
- __________________________________
- __________________________________
New images or sounds:
- __________________________________
- __________________________________
Check: how do I know it works?
- __________________________________Showcase
At the end of the session you show a coach and your buddy what you built. Tell them in 30 seconds:
- What you wanted to make
- Whether it worked
- What was the hardest part
Step-by-step plan (for when you can’t figure it out yourself)
- Open
main.pyin Thonny and click Run — does it still work? - Make a copy of the game folder in case you get stuck.
- Start with the smallest possible change (e.g. adding a variable).
- Test. Does it work? → Next step. Doesn’t it work? → Ask a coach.
See you next time!
“Next time: a completely new game. What will it be?”