CORE PYTHON FOUNDATION · MODULE 2 CAPSTONE · UNITS 5–8
Defend the Ember Kingdom
You are back at CodeQuest Studios. Nova has escaped the Shadow Castle, but a new mission has begun. Build battle moves with functions, create smarter quest decisions, survive enemy waves with advanced loops, and finish by creating a simple character dialogue engine.
What You Will Apply
Unit 5 · FunctionsDefine and call functions, use parameters, use multiple parameters, and return calculated battle damage.
Unit 6 · Advanced ConditionsUse if, else, elif, and the logical operators and/or to build quest rules with several outcomes.
Unit 7 · Advanced LoopsCombine loops with conditions, break, continue, nested loops, and a simple stop flag for enemy waves.
Unit 8 · StringsBuild dynamic dialogue, clean text with string methods, detect commands, and slice text into useful pieces.
Teen-friendly design: Every challenge uses short code and one main idea at a time. No classes, files, dictionaries, or advanced libraries are needed. Use Run & Verify, two hints, the AI Tutor, and the solution unlock after three failed attempts.
Your Game Mission
Nova must protect the Ember Kingdom by building a battle system, passing quest gates, surviving enemy waves, and understanding commands from the kingdom’s characters.
Battle Damage CalculatorCreate reusable attack code with parameters and return values.
Quest Decision SystemMake the game choose outcomes using smarter conditions.
Wave Survival ChallengeProcess enemies with advanced loops and stop controls.
Character Dialogue EngineBuild and understand game text, names, and player commands.