CodeQuest ๐ŸŽฎ

Learn Python Through Adventure - A Platformer Game That Teaches Real Coding


๐ŸŽฏ Inspiration

Learning to code can feel intimidating and abstract, especially for beginners who struggle to connect theory with practice. We asked ourselves: What if learning Python felt like playing a video game?

CodeQuest was born from the idea that education doesn't have to be boring. Instead of staring at documentation or watching tutorials, what if students could literally collect code snippets, configure them through interactive dialogues, and watch their programs come to lifeโ€”all while jumping through a beautiful winter wonderland?

We wanted to bridge the gap between "Hello World" and real applications by making the learning journey visual, interactive, and genuinely fun.


๐Ÿ’ก What It Does

CodeQuest is an educational platformer game where players learn Python by building in complete applications:

๐ŸŽจ Key Features

๐ŸŽ“ Progressive Learning System

  • 4 Phases guiding students from basics to advanced concepts
  • Phase-locked progression ensures foundational understanding
  • Visual feedback shows code building in real-time

๐ŸŽฎ Full Controller Support

  • PS5/PlayStation controller integration for accessible gameplay
  • On-screen keyboard for text input with controller
  • Seamless fallback to keyboard controls
  • Toggle controller support from main menu

๐Ÿค– AI-Powered Code Mentoring

  • Google Gemini AI integration for intelligent code review
  • Automatically fixes bugs in student-generated code
  • Provides personalized improvement suggestions
  • Exports both original and AI-optimized versions

๐Ÿ“Š Live Code Visualization

  • Real-time code panel showing program construction
  • Two view modes: Diagram View (visual flowchart) and Code View (Python syntax)
  • Syntax highlighting and proper indentation
  • One-click export to runnable .py files

โœจ Beautiful Game Design

  • Hand-crafted winter-themed platformer levels
  • Smooth sprite animations and particle effects
  • Dynamic weather system (snow, rain, clouds)
  • Pastel UI inspired by "Dumb Ways to Die"
  • Professional sound design with 5 custom sound effects

๐Ÿ› ๏ธ How We Built It

Tech Stack

Game Engine & Core

  • Python 3.10 - Primary language for educational value
  • Pygame 2.6.1 - Game framework for rendering, physics, and input
  • PlayStation Controller API - Hardware input integration

AI & Intelligence

  • Google Gemini 2.5 Flash - Code analysis and refactoring
  • Custom prompt engineering for educational feedback

Frontend (Landing Page)

  • Next.js 14 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • Shadcn/UI - Accessible component library

Architecture Highlights

1. Modular Game Engine

game/
โ”œโ”€โ”€ main.py              # Main menu & calculator game
โ”œโ”€โ”€ weather.py           # Weather app game
โ”œโ”€โ”€ player.py            # Shared player physics & sprites
โ”œโ”€โ”€ code_panel.py        # Live code visualization panel
โ””โ”€โ”€ calculator_game.py   # Calculator game logic

2. Phase-Based Learning System

  • PhaseTracker class monitors student progress
  • CodeItem objects represent collectible code concepts
  • ConfigPanel provides context-sensitive configuration dialogues
  • Items unlock progressively based on completion

3. Controller Input System

  • ControllerManager abstracts input from controllers and keyboards
  • OnScreenKeyboard enables text input via controller navigation
  • Edge detection prevents input double-firing
  • Analog stick and D-pad support with dead zones

4. AI Integration Pipeline

# Two-stage Gemini AI processing:
1. Code Fixing: Analyzes student code, fixes bugs, adds error handling
2. Recommendations: Generates educational improvement suggestions
3. Dual Export: Saves both original and AI-fixed versions

5. Real-Time Code Generation

  • CodePanel class manages live code display
  • Diagram view generates visual flowcharts
  • Code view maintains proper Python syntax and indentation
  • Supports syntax highlighting and scrolling

๐ŸŽ‰ Accomplishments We're Proud Of

โœ… Created a genuinely fun learning experience - Students learn by playing, not studying

โœ… Full PlayStation controller support - Accessible gaming with professional-grade input handling

โœ… AI mentorship integration - First educational game to use Gemini AI for personalized code feedback

โœ… Real code generation - Students create actual runnable Python programs, not pseudocode

โœ… Beautiful UX/UI - Pastel aesthetic inspired by award-winning casual games

โœ… Two complete curricula - Calculator and Weather App teach complementary Python concepts

โœ… Open source and extensible - Modular architecture allows adding new game levels easily


๐Ÿš€ What's Next for CodeQuest

Near-Term Roadmap (Next 3 Months)

  1. More Games ๐ŸŽฎ

    • Todo List App - Teaches lists, loops, file I/O
    • Password Generator - Teaches randomization, string manipulation
    • Freestyle mode - Allows you to AI prompt any project and create it along with real-time visualization
  2. Multiplayer Mode ๐Ÿค

    • Collaborative code building with friends
    • Race mode: Who can build their app faster?
    • Code review challenges
  3. Achievement System ๐Ÿ†

    • Badges for completing challenges
    • Leaderboards for speedruns
    • Unlock cosmetic character skins

Long-Term Vision (6-12 Months)

  1. Level Editor ๐Ÿ› ๏ธ

    • Teachers create custom learning paths
    • Community-shared level marketplace
    • Import custom code challenges
  2. Mobile Version ๐Ÿ“ฑ

    • iOS/Android ports using Kivy
    • Touch-optimized controls
    • Cloud save progress
  3. Classroom Integration ๐Ÿซ

    • Teacher dashboard for monitoring progress
    • Standards-aligned curriculum mapping

    - Auto-grading for assignments

"The best way to learn is to play."

Built With

Share this project:

Updates