Dojo Defender Session 6: Demo

How to demo the solution

  1. Open a terminal in the project folder.
  2. Run:
uv run python3 code/sessions/07-bug-zapper/dojo-defender-solution/main.py
  1. Show:

    • SPACE starts the game, shoot until wave 5
    • Wave 5: the boss comes in from above
    • HP bar at the top: green → yellow → red as HP drops
    • Phase 1: drifting slowly, now and then a red bullet
    • Phase 2: moving faster, more bullets, minions spawning
    • Phase 3: screen shakes, 2 bullets at once
    • Phase transition: boss flashes white
    • Defeating the boss: big explosion + “BOSS DEFEATED!” + 500 points
    • Ordinary waves continue after the boss
  2. Code highlights to show:

    • start_boss() and check_boss_wave() — how the boss starts
    • fire_boss_bullet() — homing bullet with vector maths
    • Boss update in the game loop: if boss_phase == ...
    • Drawing the HP bar with pygame.draw.rect
    • Screen shake: screen_shake_x = random.randint(-3, 3)
    • EXPLODING phase: particle bursts