Grade Level: Middle School Time Required: 1-2 Class Periods (45-60 minutes each) Subject: Computer Science / Game Design Tools Needed: KODU Game Lab, Computers
Lesson Objectives
Students will: ✅ Design an underwater combat game using KODU Game Lab. ✅ Program a controllable submarine with torpedo-launching mechanics. ✅ Add AI-controlled enemy sea creatures (like sharks) that chase and attack the player. ✅ Implement scoring, health, and game-over conditions. ✅ Learn basic AI behaviors, movement logic, and object interactions.
(Video help links could be inserted here if available)
1. Introduction (10-15 minutes)
Discuss underwater-based video games and their common mechanics (e.g., Subnautica, Abzû, underwater levels in Super Mario).
Show key concepts or video frames to highlight:
Submarine movement (gliding, turning, ascending/descending).
Shooting mechanics (torpedoes, bubbles, sonic pulses).
Enemy AI (sharks circling, piranhas swarming, octopus hiding).
Health & scoring systems (tracking oxygen/hull integrity, collecting treasure).
Ask students:
What makes a fun underwater exploration or combat game?
How should the submarine move and shoot?
How should enemy sea creatures behave to be challenging but fair?
2. Hands-On Activity (30-40 minutes)
Step 1: Creating the World
Open KODU Game Lab and create a new world.
Use the Ground Brush to paint a large area with water terrain. Use the "Up/Down" tool to create deep trenches and high plateaus.
Add underwater scenery like coral reefs, seaweed, underwater caves, and shipwrecks to make the world feel alive.
Place a starting position for the player’s submarine.
Step 2: Adding the Player’s Submarine
Add a Sub object from the KODU menu to act as the player’s vehicle.
Program its movement:
WHEN: Keyboard / W,A,S,D → DO: Move
Step 3: Implementing Shooting Mechanics
Program the submarine to fire projectiles.
Program shooting:
WHEN: Keyboard / Spacebar → DO: Shoot / Blip (or Missile)
Let's call the projectiles "torpedoes."
Program hit detection:
WHEN: My Torpedo / Bumps / Enemy (Fish, etc.) → DO: Enemy / Vanish
AND DO: Score / +1 Point
Step 4: Adding Enemy AI
Place several Fish objects (you can change their color to red to signify they are enemies). Let's call them "Piranhas" or "Sharks."
Program enemy behavior:
WHEN: See / Sub / In my line of sight → DO: Move / Toward
WHEN: Bump / Sub → DO: Combat / Damage / 10 points (or your desired amount)
Step 5: Adding Health & Game Over Conditions
Program the player’s health. By default, the Sub has health. The damage from Step 4 will reduce it.
Program the game-over state:
WHEN: Health / Is Zero → DO: Game / End
Step 6: Adding a Scoring System
Create a score variable. KODU can often track this by color (e.g., Red Score).
Program scoring logic (completed in Step 3).
Program a win condition:
WHEN: Score / Red / Compare / 10 Points → DO: Game / Win
3. Testing & Debugging (15 minutes)
Students play their game to test submarine speed, enemy difficulty, and torpedo effectiveness.
Encourage them to adjust values. Is the submarine too slow? Are the enemies too fast?
Discuss debugging strategies: If enemies get stuck, check the pathing. If scoring doesn't work, check the WHEN conditions on the torpedo.
4. Reflection & Discussion (10 minutes)
Ask students:
What was the most challenging part to program?
How could you make the enemy AI smarter or more interesting?
What other features would you add to your underwater world (e.g., treasure, power-ups, a giant squid boss)?
✔️ Creativity: Unique design of the underwater environment and choice of objects. ✔️ Programming Logic: Correct implementation of movement, shooting, scoring, and AI behaviors. ✔️ Problem-Solving: Ability to debug and refine gameplay mechanics based on testing. ✔️ Engagement: Active participation in class discussions and peer testing.
Power-ups: Add objects that give temporary shields (a bubble), speed boosts, or rapid-fire torpedoes.
More AI Behaviors: Program some fish to flee, others to patrol a specific area (like guarding a shipwreck), or have enemies that only attack when the player gets close.
Boss Battle: Create a single, large, powerful enemy (like a Cycle object re-skinned as a Kraken or Giant Shark) that takes multiple hits to defeat.
Resource Management: Add "oxygen" as a resource. The player must occasionally surface or find oxygen plants to replenish it. WHEN: Timer 60 seconds → DO: Game / End.
This lesson strongly aligns with modern educational frameworks by integrating technology, engineering design, and critical thinking.
1. Demonstrating Personal Qualities and Abilities
✔ Demonstrate creativity and innovation → Students design their own unique underwater world, choosing the layout of coral reefs, caves, and enemy placements.
✔ Demonstrate critical thinking and problem-solving → They must debug issues with enemy AI pathfinding, torpedo logic, and scoring systems.
✔ Demonstrate initiative and self-direction → Students independently plan, build, test, and refine their underwater game from concept to playable prototype.
2. Demonstrating Interpersonal Skills
✔ Collaborate with team members → In pairs, students can delegate tasks like world design and character programming, and collaborate on debugging.
✔ Demonstrate listening and speaking skills → During reflection, they explain their game's logic and design choices to peers.
3. Demonstrating Professional Competencies
✔ Demonstrate big-picture thinking → Students understand how individual systems (movement, AI, health, scoring) interact to create a cohesive gameplay experience.
✔ Demonstrate continuous learning and adaptability → They adjust game mechanics based on play-testing feedback to improve fun and challenge.
✔ Manage time and resources → They must complete their game prototype within the allotted class time.
✔ Demonstrate proficiency with technologies, tools, and machines → Using KODU Game Lab introduces fundamental concepts of game engines, visual programming, and AI.
4. Introducing Technology
✔ Define technology → Students explore how a game engine (KODU) and its rule-based AI systems are a form of technology used to create interactive entertainment.
✔ Identify how technologies have emerged through the use of engineering → They see how programming AI movement and physics simulations create immersive digital experiences.
5. Investigating the Effects of Technology
✔ Describe how society affects technology and technology affects society → Students can discuss how underwater games can raise awareness for marine biology or reflect our fascination with ocean exploration, linking to real-world technologies like Autonomous Underwater Vehicles (AUVs) and deep-sea submersibles.
6. Examining Resources of Technology
✔ Demonstrate the safe use of a minimum of three tools and/or pieces of equipment as part of the design process → Students use KODU’s terrain tools, object placement tools, and the visual programming editor to build their world.
7. Designing Solutions
✔ Describe the Virginia Department of Education (VDOE) engineering design process → The lesson follows a clear design cycle: Plan (Introduction) → Create (Hands-On) → Test/Debug → Improve (Reflection/Bonus Challenges).
✔ Demonstrate the use of an engineering design process → Students define their game's goal, program AI according to criteria, test mechanics, and evaluate their final design.
8. Using the Engineering Design Process
✔ Define the goal of a challenge → The goal is to create a fun and engaging underwater combat game.
✔ Design a device using criteria and constraints → They program AI-controlled sharks with specific movement and attack logic.
✔ Evaluate viable solutions → Students test different enemy speeds and torpedo damage values to find a good balance.
✔ Select a solution → They choose the best combination of mechanics for fun gameplay.
✔ Plan the model or prototype → Students lay out their underwater terrain, obstacles, and enemy positions.
✔ Produce a model or prototype → They build the KODU submarine game with working AI, scoring, and combat.
✔ Assess the design → Students test their game, identify bugs, and make improvements.
✔ Describe how the solution could be improved → They brainstorm bonus features like a boss battle or power-ups.
✔ Communicate the results → They share their finished game with classmates and discuss the design process.
9. Examining Systems
✔ Illustrate how processes change inputs to outputs in any system → Students program inputs (keyboard presses for movement and shooting) and see the direct outputs (submarine moves, a torpedo fires, an enemy reacts).
10. Identifying the Contexts of Technology and Engineering
✔ Describe the computation, automation, AI, and robotics contexts of technology and engineering → Students directly program AI-controlled sea creatures, learning how simple, rule-based programming can create the illusion of intelligent, automated behavior, linking directly to principles used in robotics and AI.
This Submarine Showdown lesson provides a robust framework for teaching game design, programming logic, and creative problem-solving in a context that is engaging and fun for middle school students. 🎮🐠