L04 ยท T2 Week 2 ๐ŸŽฏ CT5-DPM-01 ยท CT5-COM-01 ๐Ÿ“‚ Phase 1 โ€” Python Refresher

Lesson 4: Classes Part 2 + Text Adventure Checkpoint

Learning Intentions

Success Criteria

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

What does super().__init__(name, hp) do? Guess first, then we'll unpack it.

๐Ÿ‘ I Do โ€” Teacher Demo

Live-code inheritance: Hero(Character), call super() in __init__, add special_attack method. Show what you inherit for free + what you add on top.

๐Ÿค We Do โ€” Build Together

Build a 2-class text adventure skeleton together: Hero(Character) + Enemy(Character), main game loop with while-loop, one room function.

๐Ÿš€ You Do โ€” Your Turn

Finish adventure_v1.py โ€” your first Python submission this term. At minimum: 2 classes, 2 rooms, works end-to-end. Save as adventure_v1_[yourname].py + upload to Classroom.

  • Hero(Character) with special_attack()
  • Enemy(Character) with random AI
  • Text adventure main loop with hero vs enemy

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

Loading practice quests for this lesson...

Three tiers โ€” pick yours

Support

provide a Hero template; fill in 1 method

Core

build both classes from scratch

Extension

3+ inherited classes with polymorphism

Extensions

๐Ÿ“ Exit Ticket โ€” Coding Journal

Journal: upload your adventure_v1.py + write 1 sentence on what you're proud of.

Evidence of Learning

adventure_v1.py submitted. Uses 2+ classes. Runs.

โ† PreviousLesson L03โ†‘ HubAll LessonsNext โ†’Lesson L05