|
| 1 | +# AGENTS.md — Arkanoid |
| 2 | + |
| 3 | +## Project Overview |
| 4 | +A classic Arkanoid (brick breaker) game implemented as a single-page web application. The player controls a paddle at the bottom of the screen to bounce a ball and destroy rows of colored bricks. The game ends when the ball falls below the paddle or all bricks are destroyed. |
| 5 | + |
| 6 | +## File Structure |
| 7 | +``` |
| 8 | +arkanoid/ |
| 9 | +├── index.html — HTML structure with canvas and UI controls |
| 10 | +├── style.css — All styling (Catppuccin Mocha theme) |
| 11 | +└── script.js — All game logic (ball, paddle, bricks, collision) |
| 12 | +``` |
| 13 | + |
| 14 | +## Constraints |
| 15 | + |
| 16 | +### Styling |
| 17 | +- **Use Catppuccin Mocha palette** exclusively. |
| 18 | +- **No light mode** — dark theme only, always. |
| 19 | + |
| 20 | +### Code Organization |
| 21 | +- **Separate CSS and JS from HTML.** Keep styles in `style.css` and logic in `script.js`; never inline them in `index.html`. |
| 22 | +- Each file has a single responsibility. |
| 23 | +- **JSDoc with type hints required.** All variables, constants, and functions must include JDoc comments with proper `@typedef`, `@type`, parameter types, and return type annotations. |
| 24 | + |
| 25 | +### Game Features |
| 26 | +- Ball bounces off walls, paddle, and bricks |
| 27 | +- Paddle controlled by mouse or keyboard (arrow keys / WASD) |
| 28 | +- Multiple rows of colored bricks |
| 29 | +- Score tracking |
| 30 | +- Lives system (3 lives) |
| 31 | +- Level progression (win when all bricks destroyed) |
| 32 | +- Game over when lives reach 0 |
| 33 | +- Restart option |
| 34 | + |
| 35 | +### UI Elements |
| 36 | +- Start/Pause button |
| 37 | +- Score and lives display |
| 38 | +- Game over / win overlay with restart button |
| 39 | +- "Back to Main Page" button linking to `../index.html` |
| 40 | + |
| 41 | +## Catppuccin Mocha Colors (Reference) |
| 42 | +| Token | Hex | Usage | |
| 43 | +|------------|----------|---------------------------| |
| 44 | +| Base | `#1e1e2e`| Main background | |
| 45 | +| Mantle | `#181825`| Container/surface bg | |
| 46 | +| Crust | `#11111b`| Darkest elements | |
| 47 | +| Surface 0 | `#313244`| Inputs, cards | |
| 48 | +| Surface 1 | `#45475a`| Borders, dividers | |
| 49 | +| Subtext 0 | `#a6adc8`| Labels, secondary text | |
| 50 | +| Text | `#cdd6f4`| Primary text | |
| 51 | +| Lavender | `#b4befe`| Headings | |
| 52 | +| Blue | `#89b4fa`| Buttons, focus borders | |
| 53 | +| Mauve | `#cba6f7`| Section titles | |
| 54 | +| Green | `#a6e3a1`| Positive values, paddle | |
| 55 | +| Red | `#f38ba8`| Negative values, errors | |
| 56 | +| Peach | `#fab387`| Bricks row color | |
| 57 | +| Yellow | `#f9e2af`| Bricks row color | |
| 58 | +| Rosewater | `#f5c2e7`| Bricks row color | |
| 59 | + |
| 60 | +## Game Mechanics |
| 61 | +- **Canvas Size:** 480x600 pixels |
| 62 | +- **Paddle:** 80px wide, 12px high, moves horizontally |
| 63 | +- **Ball:** 8px radius |
| 64 | +- **Bricks:** 60px wide, 18px high, 5 rows x 7 columns |
| 65 | +- **Initial Speed:** 4 px/frame for ball |
| 66 | +- **Lives:** 3 |
| 67 | +- **Controls:** Mouse movement or arrow keys / A,D |
0 commit comments