L05 ยท T2 Week 3 ๐ŸŽฏ CT5-DPM-01 ยท CT5-EVL-01 ๐Ÿ“‚ Phase 2 โ€” Alien Invasion ยท Ch 12 Ship + Bullets

Lesson 5: Pygame Setup + First Window (Matthes Ch 12 ยง1-3)

Learning Intentions

Success Criteria

๐Ÿ“ Do Now โ€” Error of the Day

Type pip --version in your terminal. What comes up? (This checks if pip is installed โ€” it comes free with Python.)

๐Ÿ‘ I Do โ€” Teacher Demo

Live-install pygame (pip install pygame), then live-code the minimal 20-line Pygame skeleton: init, display.set_mode, event loop, fill, flip. Explain what each line does.

๐Ÿค We Do โ€” Build Together

Class types along โ€” everyone gets a Pygame window open. Verify: raise hand if your window opens. We troubleshoot install issues 1-on-1.

๐Ÿš€ You Do โ€” Your Turn

Customise your window: size, background colour, title bar text. Try 3 different colour schemes. Arcade quests below cover event loop basics.

  • pip install pygame (troubleshoot 1:1)
  • Type the minimal Pygame skeleton from scratch
  • Change window size + background colour
  • Understand what each of pygame.init(), display.set_mode, event.get, display.flip does

๐ŸŽฎ Practice Quests โ€” work through these

Loading practice quests for this lesson...

Three tiers โ€” pick yours

Support

alien_invasion_starter.py with skeleton pre-typed. 1:1 install help

Core

type skeleton from scratch

Extension

Settings class refactor

Extensions

๐Ÿ“ Exit Ticket โ€” Coding Journal

Journal: what's one thing about Pygame that feels different from regular Python you've done?

Evidence of Learning

Each student has a running Pygame window with custom size and colour.

โ† PreviousLesson L04โ†‘ HubAll LessonsNext โ†’Lesson L06