Snakes & Ladders - N@tM Assignment & Create PT
Team overview, individual tasks, and presentation scripts for Night at the Museum
- Skill C: Team Project Overview 1 MIN
- Individual Tasks (Skill A + Skill B)
- Akhil
- Skill A: Task — WebSocket Multiplayer & Victory System 1 MIN
- Skill B: Code Reference (PPR)
- Moiz
- Skill A: Task — JWT Authentication & Guest Mode 1 MIN
- Skill B: Code Reference (PPR)
- Samarth
- Skill A: Task — Interactive Lesson Completion & Section Unlocking 1 MIN
- Skill B: Code Reference (PPR)
- Arnav
- Skill A: Task — Boss Battle Arena & PvP Combat 1 MIN
- Skill B: Code Reference (PPR)
- Ethan
- Skill A: Task — Question Bank & Answer Validation 1 MIN
- Skill B: Code Reference (PPR)
- Aneesh
- Skill A: Task — Game Board UI, Dice Rolling & Mode Selection 1 MIN
- Skill B: Code Reference (PPR)
- Akhil
- Visual Demos
- Presentation Scripts
- Team Overview Script (1 minute)
- Speaker: Any team member
- Akhil’s Script (1 minute)
- Topic: Multiplayer & Victory System
- Moiz’s Script (1 minute)
- Topic: Authentication & Deployment
- Samarth’s Script (1 minute)
- Topic: Lesson System & Progression
- Arnav’s Script (1 minute)
- Topic: Boss Battle & PvP Combat
- Ethan’s Script (1 minute)
- Topic: Question System
- Aneesh’s Script (1 minute)
- Topic: Game Board & Navigation
- Team Overview Script (1 minute)
- Happy Moments / Eureka Events
- Feature Lifecycle Example: Victory System
- Quick Reference: Key Files
- Deployment Info
- N@tM Checklist
Skill C: Team Project Overview 1 MIN
Complete Game Flow
Data Flow Architecture
Individual Tasks (Skill A + Skill B)
Akhil
Skill A: Task — WebSocket Multiplayer & Victory System 1 MIN
**Problem Solved:** Enable real-time multiplayer gameplay with instant position sync, group chat, and persistent victory tracking in the Hall of Champions. **Demo Flow:** 1. Join boss battle → WebSocket connects → see other players appear 2. Move around → position broadcasts to all players every 50ms 3. Defeat boss → Victory page with confetti animation 4. Champions API records completion → Hall of Champions displays all winnersSkill B: Code Reference (PPR)
**Input:** Player position data, chat messages, game completion **Output:** Broadcast to all players, victory recording, champions listMoiz
Skill A: Task — JWT Authentication & Guest Mode 1 MIN
**Problem Solved:** Secure user sessions without exposing credentials; provide guest mode for quick demos without signup. **Demo Flow:** 1. Login → JWT token stored in HttpOnly cookie 2. API call → `@token_required()` validates token 3. User ID extracted → correct game data loaded 4. Guest mode → sessionStorage fallback, no server persistenceSkill B: Code Reference (PPR)
**Input:** Login credentials (POST /api/authenticate) **Output:** JWT token + user session; or sessionStorage for guestsSamarth
Skill A: Task — Interactive Lesson Completion & Section Unlocking 1 MIN
**Problem Solved:** Teach CS concepts and reward learning with in-game currency (bullets); enforce learning before playing. **Demo Flow:** 1. Open lesson → read content → complete quiz 2. POST /complete-lesson → server awards bullets 3. Progress bar fills → `unlocked_sections` updates 4. All 5 lessons done → boss section unlocks automaticallySkill B: Code Reference (PPR)
**Input:** Lesson completion (lesson_number, bullets_earned) **Output:** Updated total_bullets, completed_lessons[], unlocked_sections[]Arnav
Skill A: Task — Boss Battle Arena & PvP Combat 1 MIN
**Problem Solved:** Create engaging final challenges with smooth boss AI movement, powerup mechanics, and competitive 1v1 PvP duels. **Demo Flow:** 1. Enter boss arena → boss spawns with 1000 HP, slithering movement 2. WASD move, click to shoot → bullets reduce boss HP 3. Collect powerups → damage boost/speed/rapidfire/heal 4. PvP mode → 1v1 duel with center wall, first to eliminate winsSkill B: Code Reference (PPR)
**Input:** Player position, shoot command, powerup collection **Output:** Boss damage, powerup effects, PvP hit detectionEthan
Skill A: Task — Question Bank & Answer Validation 1 MIN
**Problem Solved:** Test knowledge with 50 unique questions across 5 CS topics; reward correct answers with bullets; prevent re-answering. **Demo Flow:** 1. Land on square → question modal appears 2. Select answer → validation runs against correct index 3. Correct = +5 bullets + green feedback | Wrong = red feedback 4. Square added to `visited_squares` → can't answer againSkill B: Code Reference (PPR)
**Input:** Answer selection (square, answer_index) **Output:** Bullet reward, updated visited_squares[], visual feedbackAneesh
Skill A: Task — Game Board UI, Dice Rolling & Mode Selection 1 MIN
**Problem Solved:** Players need intuitive navigation across 56 squares with visual feedback, character selection, and clear mode choices. **Demo Flow:** 1. Select character from carousel → pixel-art sprites 2. Click dice → animated roll → land on square 3. Square highlights → question modal opens 4. Reach square 56 → Mode Selection hub → choose Boss Battle or PvPSkill B: Code Reference (PPR)
**Input:** Dice click event, character selection, mode choice **Output:** New square position, character assignment, navigation to battleVisual Demos
Presentation Scripts
Team Overview Script (1 minute)
Speaker: Any team member
[0:00-0:15] "This is Snakes and Ladders, an educational game that teaches AP Computer Science Principles. The twist? Knowledge is power — bullets earned from lessons become ammo in boss battles and PvP duels."
[0:15-0:30] "Players complete 5 interactive lessons, then roll dice across 50 question squares. Each correct answer adds to their bullet count. When ready, they choose between a 10-player cooperative boss fight or a 1v1 PvP arena."
[0:30-0:45] "Winners reach the Victory page with confetti animation and join the Hall of Champions — a permanent leaderboard of everyone who's beaten the game."
[0:45-0:60] "Tech stack: Jekyll frontend, Flask backend, SQLite database, and Socket.IO for real-time multiplayer. Everything persists via JWT-authenticated APIs. Let me show you how it works..."
Akhil’s Script (1 minute)
Topic: Multiplayer & Victory System
[0:00-0:15] "I built the real-time multiplayer system. When you join a boss battle, WebSocket connects you to a room. Every 50 milliseconds, your position broadcasts to all other players."
[0:15-0:30] "The `boss_battles` dictionary tracks every room with its players. When `handle_player_move` fires, it updates your position and emits to everyone else in the room — instant sync."
[0:30-0:45] "I also built the Victory page. When you beat the boss or win PvP, confetti animates and your stats display. The `CompleteGameAPI` marks your game as finished and records your completion time."
[0:45-0:60] "The Hall of Champions queries all completed games sorted by completion date. Your username appears forever in the leaderboard — proof you mastered the game."
Moiz’s Script (1 minute)
Topic: Authentication & Deployment
[0:00-0:15] "I handled authentication and deployment. When you log in, the server generates a JWT token stored in an HttpOnly cookie — secure and invisible to JavaScript attacks."
[0:15-0:30] "Every API call passes through the `@token_required()` decorator. It decodes the JWT, extracts your user ID, and loads your specific game data from the database."
[0:30-0:45] "For deployment, I configured Docker containers, Nginx reverse proxy, and environment variables. The backend runs on port 8306 with integrated Socket.IO."
[0:45-0:60] "Guest mode bypasses auth using sessionStorage — no server calls, perfect for quick demos at N@tM, but progress doesn't persist across sessions."
Samarth’s Script (1 minute)
Topic: Lesson System & Progression
[0:00-0:15] "I created 5 interactive lessons covering AP CSP topics — programming basics, data structures, networking, cybersecurity, and ethics. Each has content plus a mini-quiz."
[0:15-0:30] "When you complete a lesson, POST `/complete-lesson` fires. The server checks `completed_lessons` array — if this lesson isn't already there, it gets appended and you earn 5 bullets."
[0:30-0:45] "The selection logic checks if all 5 lessons are done. If so, it adds 'half2' to `unlocked_sections`, opening the question gauntlet. Finish questions, and 'boss' unlocks."
[0:45-0:60] "This sequencing ensures players learn before they battle. The bullets they earn become real firepower against the boss."
Arnav’s Script (1 minute)
Topic: Boss Battle & PvP Combat
[0:00-0:15] "I built both battle systems. The boss has 1000 HP and moves with smooth AI patterns — chase, zigzag, dash, and circle. It targets the nearest player using the distance formula."
[0:15-0:30] "Collision detection iterates through `playerBullets[]` array. For each bullet, `Math.hypot(dx, dy)` calculates distance to the boss. If within hit radius, damage applies and the bullet is filtered out."
[0:30-0:45] "The `applyPowerup(type)` procedure uses selection — 'damage' doubles your bullets' power, 'speed' increases movement, 'rapidfire' adds ammo, 'heal' restores a life."
[0:45-0:60] "PvP arena is similar but 1v1 with a center wall. Players can't cross — they must shoot over it. First to deplete the opponent's lives wins."
Ethan’s Script (1 minute)
Topic: Question System
[0:00-0:15] "I built the question bank with 50 unique questions across 5 CS topics. Each question object has the prompt, four options, the correct index, and bullet reward."
[0:15-0:30] "When a player lands on a square, JavaScript iterates through the `QUESTIONS` array using a filter to find the matching square number. That question's modal appears."
[0:30-0:45] "Answer validation is simple selection: if `selectedIndex === correct`, award bullets. The backend POST to `/answer-question` records this and appends to `visited_squares`."
[0:45-0:60] "The list prevents farming — before showing a question, we check if the square exists in `visited_squares`. If it does, no repeat answer allowed."
Aneesh’s Script (1 minute)
Topic: Game Board & Navigation
[0:00-0:15] "I built the game board interface. Watch as I click the dice — it animates with a rolling effect, lands on 1-6, and my character moves to that square with smooth transitions."
[0:15-0:30] "Character selection uses an array of four pixel-art sprites — knight, wizard, archer, warrior. A `for` loop renders all 56 board squares with dynamic CSS classes based on visit state."
[0:30-0:45] "When you reach square 56, the Mode Selection hub appears. I built this page to show both options — Boss Battle for co-op or PvP Arena for 1v1 — with real-time player counts via Socket.IO."
[0:45-0:60] "The navigation flow connects all pages seamlessly — from login to character select to board to battle to victory. Every transition saves your progress."
Happy Moments / Eureka Events
| Team Member | Eureka Moment |
|---|---|
| Akhil | “First time seeing 5 players move simultaneously in the boss arena — the WebSocket sync was flawless. Real multiplayer magic!” |
| Moiz | “First successful authenticated request after fighting CORS for hours. Seeing my user data load from the JWT was relief and triumph.” |
| Samarth | “Completing all 5 lessons and watching the boss section unlock automatically. The progression gating actually worked!” |
| Arnav | “The boss slithering movement looked so realistic. Watching it chase players across the arena was terrifying and awesome.” |
| Ethan | “Writing question #50 and seeing the entire bank render correctly. 50 unique CS questions validated in one test run.” |
| Aneesh | “When the dice animation synced perfectly with the square highlighting and character movement — the game felt alive.” |
Feature Lifecycle Example: Victory System
| Stage | Description |
|---|---|
| Origin | Players needed a satisfying ending and permanent recognition |
| Early Visual | Simple “You Win” alert box |
| Early Code | Basic redirect after boss HP = 0 |
| Polish | Confetti animation, stats display, Hall of Champions API |
| Recent | Auto-complete on first visit, play again with progress reset |
Quick Reference: Key Files
| Component | Owner | Frontend | Backend |
|---|---|---|---|
| Game Board | Aneesh | game-board-part1.html, game-board-part2.html, mode-selection.html |
api/snakes_game.py |
| Lessons | Samarth | lessons/lesson1-5.html |
api/snakes_extended.py |
| Questions | Ethan | questions/questions_bank.js, question_template.html |
api/snakes_extended.py |
| Boss Battle & PvP | Arnav | boss-battle.html, pvp-arena.html |
api/boss_battle.py, model/boss_room.py |
| Multiplayer & Victory | Akhil | victory.html |
socketio_handlers/boss_battle.py, api/snakes_game.py |
| Auth & DevOps | Moiz | — | api/jwt_authorize.py, Dockerfile, nginx.conf |
Deployment Info
| Service | Local Port | Production URL |
|---|---|---|
| Flask Backend + Socket.IO | 8306 | https://snakes.opencodingsociety.com |
| Frontend | 4100 | Jekyll GitHub Pages |
N@tM Checklist
| Requirement | Status | Owner |
|---|---|---|
| Team 1-min overview | ✅ | All |
| Individual 1-min videos (6) | ✅ | Each member |
| Input/Output demonstrated | ✅ | All tasks |
| List usage shown | ✅ | All tasks |
| Procedure with parameter | ✅ | All tasks |
| Algorithm (seq + sel + iter) | ✅ | Arnav (collision), Ethan (question lookup), Samarth (Game Flow/Progression) |
| Transactional data (CRUD) | ✅ | Samarth (lessons), Ethan (questions), Akhil (champions) |
| Deployment demo ready | ✅ | Moiz |