Act as an expert game designer, gameplay programmer, and UI/...
Prompt
Act as an expert game designer, gameplay programmer, and UI/UX artist. Build a complete, original browser game with the polish of a small premium indie release. Prioritize satisfying gameplay, reliability, and attention to detail over excessive features. Make practical design decisions without asking follow-up questions. GAME CONCEPT Create a visually striking top-down arena survival game with: - Fast, responsive movement and automatic attacks. - Short, replayable runs lasting approximately 3–5 minutes. - Escalating enemy waves followed by a final boss. - Collectible experience and meaningful upgrade choices. - A distinctive original name, cohesive visual identity, and clear objective. The player should understand the basics within 10 seconds and immediately want to try another run after losing. TECHNICAL REQUIREMENTS - Deliver the entire game in ONE self-contained HTML file. - Include all HTML, CSS, and JavaScript in that file. - Use vanilla JavaScript and Canvas 2D. No build tools, frameworks, external assets, network requests, or installation. - Generate artwork using shapes, particles, gradients, and procedural drawing. - Generate sound effects with the Web Audio API, activated only after a user interaction. - The game must work when the HTML file is opened directly in a modern browser. GAMEPLAY - Use WASD or arrow keys to move and Space to dash. - Automatically aim and fire at suitable nearby enemies. - Normalize diagonal movement so it provides no speed advantage. - Include at least four enemy types with clearly different behavior and silhouettes. - Telegraph dangerous attacks and keep damage avoidable through skill. - Spawn enemies safely away from the player. - Include at least six useful upgrades that noticeably affect gameplay. - Pause the action while the player chooses an upgrade. - Add a final boss with readable attack patterns and a clear victory condition. - Balance difficulty so early play teaches the mechanics and later play rewards mastery. - Prevent unavoidable damage chains with brief, clearly indicated invulnerability after taking a hit. COMPLETE GAME FLOW Implement: 1. A polished title screen with Play, How to Play, and sound controls. 2. Concise onboarding that teaches controls without a lengthy tutorial. 3. A readable HUD showing health, score, experience, time, and dash cooldown. 4. Pause and resume functionality. 5. Upgrade selection with clear descriptions. 6. Distinct victory and defeat screens with useful run statistics. 7. Instant replay without reloading the page. 8. Persistent best score and settings using localStorage, with graceful fallback if storage is unavailable. VISUAL AND AUDIO POLISH - Use a cohesive palette, strong contrast, attractive typography, and consistent UI styling. - Make enemies, projectiles, pickups, and hazards immediately distinguishable. - Add restrained particle effects, hit flashes, satisfying pickup animations, and subtle screen shake. - Give buttons clear hover, focus, and pressed states. - Include distinct sounds for attacks, damage, upgrades, defeat, and victory. - Provide a mute toggle and reduced-motion option. - Avoid excessive flashing, visual clutter, and effects that obscure gameplay. - Do not rely on color alone to communicate important information. MOBILE AND RESPONSIVE SUPPORT - Support desktop and mobile layouts without clipping or overlapping controls. - Provide a virtual movement joystick and a large dash button on touch devices. - Ensure simultaneous movement and dash inputs work correctly. - Include an accessible on-screen pause button. - Prevent browser scrolling while interacting with game controls. - Keep gameplay coordinates, visual scaling, and input coordinates aligned when resizing. ENGINEERING QUALITY - Use requestAnimationFrame and delta-time-based movement. - Clamp unusually large frame deltas and pause when the page becomes hidden. - Maintain exactly one active game loop. - Handle device pixel ratio without making rendering unnecessarily expensive. - Cap particles and other temporary objects to avoid runaway memory usage. - Remove expired projectiles, enemies, effects, and unused event listeners. - Organize the code into understandable systems for input, state, entities, collisions, rendering, audio, and UI. - Make restarting reset every relevant gameplay variable. - Ensure paused gameplay cannot continue dealing damage or advancing timers. QUALITY BAR A smaller, cohesive, finished game is better than a larger, broken one. Every visible button must work. Every mechanic must be implemented. Do not include placeholder screens, TODO comments, fake multiplayer, unfinished features, or promises of future functionality. Before delivering, review the complete start → play → upgrade → pause → resume → win/lose → restart flow. Check collision behavior, touch input, resizing, sound activation, save failures, and repeated restarts. Fix issues you identify. If you cannot execute the game, do not claim it was tested. OUTPUT Return only the finished HTML document in a single code block, including all CSS and JavaScript. Do not provide a plan, pseudocode, installation instructions, or a partial implementation. Make the first 30 seconds feel excellent, and make the entire game genuinely playable.
A system prompt was added to support web rendering
Response not available
Response not available