Prompt for the AI Project Title: Shufflepuck Café – Single-File JavaScript Game Overall Requirements 1. Single-File JavaScript • All logic, game states, opponent data, and (placeholder) assets should be contained in one JavaScript file. • Basic HTML scaffolding and minimal CSS can be inlined or included as placeholders if needed, but the focus is on a single .js file containing all core functionality. 2. Game Modes • Tournament Mode: The player faces a series of opponents in increasing difficulty until they defeat the final champion (Biff Raunch). • Practice Mode: The player can select any opponent to practice with in a single match. (Opponents’ behaviors/weaknesses remain the same as in Tournament Mode.) 3. Physics & Rendering Options • Use vanilla JavaScript or leverage Three.js (for 3D rendering) and Cannon.js (for physics simulation) to manage: • Puck movement and collisions • Paddle (bat) movement and collisions • Table boundaries and scoring zones • If using Three.js/Cannon.js, create simple 3D geometries (cylinders, spheres, planes, etc.) to represent the puck, paddles, and table. • If no libraries are used, implement a simple 2D physics system (e.g., bounding box collision, reflection angles, etc.) in plain JavaScript. 4. Core Gameplay • A top-down or 3D table where the puck slides on a flat surface. • Mouse Control: The player’s paddle/bat should follow the mouse (or touch) along one side of the table. • Scoring: • Each time a puck is knocked past an opponent’s paddle, award a point to the scoring player. • The first to reach a set target (default 15) wins. • Cheat Option (if included): The player can instantly: • Win or lose the current match • Win or lose the entire tournament • Gain or lose five points • Main Menu: • Let the user select Practice or Tournament. • Within Practice Mode, let the user choose an opponent from a list. • In Tournament Mode, progress through the full roster in order until the final match is won or lost. 5. Opponent Roster & Behaviors • Each opponent should have: • A basic AI controlling the paddle, with difficulty-based parameters (reaction time, maximum speed, shot angles, “quirks”). • A short description or “flavor text” shown on-screen (could be a simple text overlay or a placeholder area). • Optional serve pattern or “special move.” Recreate the feel of Shufflepuck Café with these opponents (in approximate order of difficulty): 1. Skip Feeney: • A very nervous, slow-to-react rookie. • Easiest to beat; minimal paddle speed. 2. Visine Orb (green alien): • Jitters the paddle quickly, making serves somewhat chaotic. • Slightly harder than Skip due to the erratic serves. 3. Vinnie the Dweeb: • Calm, consistent. Medium difficulty. • Not very strong but rarely misses easy shots. 4. Lexan Smythe-Worthington (lizard-like alien playboy): • Starts with fierce, fast shots. • Over time, his “accuracy” or “reaction speed” degrades as he “sips champagne.” • Gradual AI slowdown. 5. The General (pig-like alien): • Fierce and devoted. No major weaknesses, but standard “medium-high difficulty.” 6. Nerual Ttoille (non-corporeal alien): • Mirrors player’s shot power and angle. • Occasionally triggers a small on-screen effect (like “opening his robe”) for flavor text (can be a simple text or color change placeholder). 7. Princess Bejin: • Uses telekinesis to serve. Serve can shift side-to-side unpredictably. • Possible audio or text cue (e.g., “left shift” vs. “right shift”). 8. Biff Raunch (champion biker dude): • Very strong, with no exploitable weaknesses. Fast reaction time, maximum difficulty. 9. DC3 (robot waiter, optional/training): • Completely customizable difficulty and behavior, e.g., user can set DC3’s reaction time, speed, or power. • Not part of the main championship bracket. 6. Artificial Intelligence Logic Details • Each AI opponent can be configured with: • Max Paddle Speed: How fast their paddle can track the puck. • Reaction Delay: The time before they move once the puck is launched. • Error Factor: Random offset added to the AI’s aim or tracking to simulate mistakes. • Shot Strength: Controls how fast the puck rebounds off their paddle. • Unique “quirks” (e.g., Lexan’s speed reduction over time, Princess Bejin’s angled telekinesis serve, Nerual’s mirrored shots, etc.). 7. UI/UX and Controls • Implement a simple, responsive HTML canvas or Three.js scene where the user sees the table from a top-down or angled 3D perspective. • Mouse movement (or touch on mobile) should move the player’s paddle horizontally and vertically (within bounds). • Score Display: Keep track of player vs. opponent score on-screen in a straightforward HUD. • Menus: • Main Title Screen: “Shufflepuck Café” with Start / Practice / Exit. • Opponent Select Screen (Practice only). • Tournament Progress Screen (shows next opponent or final results). • Winner/Loser Screen: After each match, show a message. Provide an option to return to the main menu or continue (in Tournament). 8. Cheat System • Provide a hidden or visible button/shortcut that triggers cheat actions: • Win Match • Lose Match • Win Tournament • Lose Tournament • +5 Points / -5 Points • The user can decide if they want these cheat buttons visible, or they can be behind a keyboard shortcut. 9. Technical Structure • Aim for clean, modular code even though it’s within a single file. For example: • init() function to set up scene/canvas, audio, event listeners. • render() or update() function for the main game loop. • Opponent classes or data objects to store AI parameters and behaviors. • GameState or a similar object to handle transitions between menu, play, and end states. • Use comments to describe major sections and logic steps. 10. Placeholders for Missing Assets • For the characters (Skip, Biff, etc.), use simple textual labels, shapes, or colored placeholders. E.g.: • A rectangular (or circular) shape labeled “Skip Feeney.” • Minimal or no audio. If implementing audio, use generic beep or click placeholders. • Keep code flexible so that if custom 3D models or 2D sprites become available, they can easily replace placeholders. 11. Extensibility & Future Add-Ons • Keep the codebase open to adding new: • Characters • Difficulty tweaks • 2D/3D assets for animations • Additional sound or music • Potential for local or online scoreboard or additional “cheat” expansions. Desired Outcome By following these guidelines, the AI should generate fully functional JavaScript code that provides: 1. A shufflepuck game with correct physics (or an approximation). 2. Nine unique opponents (or more, if you choose to extend) with distinct AI parameters and behaviors. 3. Tournament and Practice Modes. 4. Optional cheat codes or direct controls to alter the game state. 5. A clean, commented, single JavaScript file that can be plugged into a minimal HTML page to run.