Create a standalone HTML file that includes both CSS and JavaScript to generate a Block Breaker game with Canvas rendering.
Classic Arcade Game: Create a standalone HTML file that includes both CSS and JavaScript to generate a Block Breaker game with Canvas rendering. The game will showcase the following core modules through object-oriented design and physical simulation: 1. **Object-oriented design**: Define game objects using classes or constructors, including `Paddle` (racket), `Ball` (ball), `Brick` (brick), and `Score` (score system). These objects encapsulate their respective properties (position, speed) and methods (drawing, updating). 2. **Canvas Rendering and Game Loop**: Use HTML5 Canvas to draw all game elements. Implement a smooth animation loop using `requestAnimationFrame` to update object states and redraw within the loop. 3. **Physics and Collision System**: Implement the trajectory of small balls and integrate a collision detection system to accurately handle collisions and rebound logic between the balls and bricks, rackets, and the edges of the canvas. 4. **Game State and Interaction Controls**: Manage game states (start, pause, finish, restart), and provide interactive features such as mouse movement, directional key control for the racket, and the spacebar for pausing/resuming. 5. **Difficulty and Progression**: Design a system for calculating scores and implement mechanisms that increase difficulty as the game progresses (e.g., by speeding up the movement of the ball). The interface features a classic arcade style, with all code integrated into a single file. JavaScript is focused on object modeling, physical simulation, collision algorithms, and state control to enable an expandable brick-breaking gameplay experience.
AST-based code pattern analysis using ast-grep for security, performance, and structural issues. Use when (1) reviewing code for security vulnerabilities, (2) analyzing React hook dependencies or performance patterns, (3) detecting structural anti-patterns across large codebases, (4) needing systematic pattern matching beyond manual inspection.
Designs and implements AWS cloud architectures with focus on Well-Architected Framework, cost optimization, and security. Use when: 1. Designing or reviewing AWS infrastructure architecture 2. Migrating workloads to AWS or between AWS services 3. Optimizing AWS costs (right-sizing, Reserved Instances, Savings Plans) 4. Implementing AWS security, compliance, or disaster recovery 5. Troubleshooting AWS service issues or performance problems