I will list the project files to understand the existing project structure and setup.
I will read package.json to check what dependencies and libraries are currently installed in the project.
I will now install lucide-react and canvas-confetti (with its types) to provide icons for our HUD, mobile touch controls, start screen, and celebration effects.
I will read src/index.css to check the current styling setup.
I will update index.html to set the webpage title to "Super Portal Bros: Aperture Kingdom", add a favicon emoji, and prevent unwanted mobile double-tap zoom for responsive touch gaming.
I will read index.html to see the exact markup and tags.
I will update index.html with the new title, favicon, and mobile-friendly viewport meta tag.
I will read src/utils/cn.ts to verify our Tailwind class utility.
I will create src/types/game.ts to define all TypeScript interfaces and types for our game entities, portal physics, tiles, collectibles, enemies, and score leaderboards.
I will create src/utils/soundSystem.ts, a Web Audio API sound synthesizer that generates instant, zero-latency 8-bit and sci-fi sound effects (portal shots, teleport whooshes, jumps, coin pickups, bounce gel springs, and victory fanfares) along with an ambient synthwave test chamber soundtrack.
I will create src/utils/levels.ts, containing 5 handcrafted test chambers that teach Mario platforming and Portal momentum physics within the first 10 seconds, plus a procedural generator for Endless Arcade mode.
I will create src/components/HUD.tsx to display real-time game statistics (score, coins, lives, timer, portal deployment status, momentum meter, and quick action toggles).
I will edit src/components/HUD.tsx to use the imported Heart icon for the player's remaining lives indicator.
I will create src/components/StartScreen.tsx, providing an Aperture Science laboratory-themed menu with mode selection (Story Campaign vs. Endless Arcade), level selector, high scores access, and an interactive physics guide.
I will edit src/components/StartScreen.tsx to remove unused imports and use the Star icon in the level cards.
I will edit src/components/StartScreen.tsx to render decorative stars on each level card to denote level challenge rating.
I will create src/components/HighScoresModal.tsx to display local high scores stored in localStorage, with filters for Campaign and Endless modes, star badges, and ranks.
I will create src/components/PauseModal.tsx to provide a pause menu with options to resume, instant restart, adjust audio/touch settings, or return to the main menu.
I will create src/components/GameOverModal.tsx to handle level completion celebrations (with star ratings and score breakdowns) as well as game-over restart prompts.
I will edit src/components/GameOverModal.tsx to remove the unused GameMode import.
I will create src/components/TouchControls.tsx to provide responsive on-screen virtual buttons (directional pad, jump, grab/drop cube, and auto-aiming portal triggers) for mobile and touchscreen gameplay.
I will edit src/components/TouchControls.tsx to remove the unused ArrowDown import.
I will create src/components/GameCanvas.tsx, which implements the 60 FPS physics engine, portal raycasting, momentum conservation teleportation, enemy AI, gel bounce physics, particle systems, screen shake, and rendering.
I will edit src/components/GameCanvas.tsx to remove the unused useState import.
I will read src/App.tsx to inspect the existing template code before replacing it with our main game controller.
I will replace src/App.tsx with our complete game application controller, managing state transitions, localStorage high score persistence, audio settings, and rendering the UI modals and game canvas.
I will edit src/App.tsx to remove the unused React import.
I will now run build_project to compile TypeScript and build the Vite application, verifying that there are no syntax errors, type errors, or bundling issues.
I have built and verified Super Portal Bros: Aperture Kingdom, a playable browser game combining the platforming of Super Mario with the portal momentum physics and puzzle mechanics of Portal 2.
🎮 What We Built:
1. Core "Mario + Portal 2" Gameplay & Physics Engine
- Portal Gun & Momentum Conservation: Fire Blue (Left Click / Q) and Orange (Right Click / E) portals onto white Aperture lunar tiles. When entering a portal, your speed is conserved and redirected out of the target portal's normal vector—allowing high-speed horizontal launches over acid pits and vertical chasms!
- Platforming & Controls: Crisp acceleration, air resistance, variable jump height (short tap vs. held jump), Coyote Time, and Jump Buffer for responsive control.
- Aperture Science Hazards & Mechanics:
- Weighted Companion Cubes: Pick up and carry cubes through portals or drop them onto Red Floor Switches to unlock Laser Gates.
- Repulsion Gel (Blue Bounce Pad): Landing on blue gel launches you skyward with spring physics.
- Propulsion Gel (Orange Speed Track): Running across orange gel doubles your running speed and leaves particle speed trails.
- Robotic Aperture Droids & Turrets: Avoid laser beams and stomp enemies from above to squish them for juicy combo multipliers!
- Question / Core Blocks: Headbutt from below or shoot portals to release golden coins, energy cores, and 1-Up health upgrades.
2. Instant Fun Within First 10 Seconds & Handcrafted Chambers
- Story Campaign (5 Handcrafted Chambers):
- Chamber 01: The Momentum Leap — Instant intro teaching running, jumping, your first enemy stomp, and launching across a giant acid pit!
- Chamber 02: Companion & Switches — Introducing Companion Cubes, switches, and laser doors.
- Chamber 03: Gel Bounces & Speed Trails — Repulsion bounce gel and propulsion speed tracks.
- Chamber 04: Turret Gauntlet — Dodging turret lasers and chaining aerial stomps.
- Chamber 05: GLaDOS Core Escape — Boss escape challenge!
- Endless Arcade Mode: A procedural level generator creating an infinite gauntlet of ascending difficulty for high-score hunters.
3. Touch & Keyboard Controls
- Desktop Keyboard & Mouse:
A / D or Arrows to move, W / Space / Up to jump, S / Down / F to grab/drop cubes, Mouse Aim + Left/Right Click (or Q / E) to shoot portals, R for instant restart, and ESC / P to pause.
- Mobile Touch UI: On-screen virtual D-pad, large responsive JUMP button, Grab/Drop button, and dedicated auto-aiming Blue and Orange portal buttons. Toggleable via the top HUD.
4. Juicy Feedback, Particles & Web Audio Synthesizer
- Juicy Visuals: Screen shake on impacts/teleports, floating "+500 MOMENTUM LEAP!" and "+100 STOMP!" score popups, portal rings, coin glitter, speed trails, and victory confetti.
- Zero-Latency Sound Synthesizer: Web Audio API sound generator producing 8-bit jump chimes, crisp sci-fi portal lasers, whoosh teleport sounds, bounce gel boings, switch clicks, and a synthwave victory fanfare—with no external audio loading delays.
5. Complete Game Loop & Modals
- Start Screen: Mode selection, level grid with star ratings, audio/touch toggles, and an interactive Physics Guide.
- Real-Time HUD: Displays lives, health bar, coins, score, combo multiplier, timer, momentum meter, and active portal status.
- Pause Menu: Instant restart (
R), audio controls, and control guide.
- Game Over & Victory Celebrations: Score breakdown (Base + Time Bonus + Coin Bonus), star ratings, custom name entry, and persistent local High Scores table stored in
localStorage.
Files built: index.html, src/types/game.ts, src/utils/soundSystem.ts, src/utils/levels.ts, src/components/HUD.tsx, src/components/StartScreen.tsx, src/components/HighScoresModal.tsx, src/components/PauseModal.tsx, src/components/GameOverModal.tsx, src/components/TouchControls.tsx, src/components/GameCanvas.tsx, src/App.tsx