Module 2 Capstone

Module 2 Capstone — Defend the Ember Kingdom
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.
def calculate_damage(base, bonus): return base + bonus command = “attack dragon” enemies = [“slime”, “goblin”, “dragon”]

Capstone flow: functions → quest decisions → advanced enemy waves → strings & dialogue → final connected mission.

DataSoSi Teen Python Project
Core Python Foundation · Module 2 Capstone · Defend the Ember Kingdom
Game Challenge
Module 2 rule: Keep your code short. Use only the tools you have learned so far and make sure you understand what each line does before moving on.
Python Game Lab
In [ ]:
Output:
Loading Python…
AI Tutor
✦ Ember Kingdom Coding Tutor
Ask me about the current challenge. I will keep explanations short, teen-friendly, and focused on the exact Module 2 skill you are practising.