# AGENTS.md
## Project
- Name: <nama game kamu>
- Stack: Phaser 3 + TypeScript + Vite
- Entry point: src/main.ts
## Rules
1. Gameplay logic lives in src/scenes. Assets live in public/assets.
2. One feature per change. Never refactor unrelated files.
3. After every change, run "npm run build" and report errors before continuing.
4. Ask before adding any dependency.
5. Prefer plain functions over classes for game systems unless state demands otherwise.
6. Never edit generated asset files by hand.
## Definition of done
- Build passes with zero type errors.
- The feature is reachable in-game with no console errors.
- No leftover debug logging in committed files.
# TASKS.md
## Phase 1 - Foundation
- [ ] Scaffold Vite + TypeScript + Phaser 3
- [ ] Create BootScene, PreloadScene, GameScene
- [ ] Player sprite + arcade physics body
## Phase 2 - Core loop
- [ ] Movement, jump, double jump
- [ ] Collision with platforms
- [ ] Camera follow + world bounds
## Phase 3 - Content
- [ ] Level 1 tilemap
- [ ] Hazards + respawn
- [ ] HUD: HP and score
## Phase 4 - Polish
- [ ] SFX + BGM
- [ ] Title screen and level complete screen
- [ ] Static deploy
## Rules
- Complete exactly one checkbox per change.
- If blocked, write the blocker under the task. Do not skip ahead.
Generate a 16-bit pixel-art spritesheet on a transparent background.
Character: <deskripsi karakter, siluet, warna utama, prop>
Grid: 4 columns x 4 rows, each cell 64x64, no gaps, no labels, no borders.
Row order: idle (4 frames), run (4), jump (2), fall (2), hurt (2), death (2).
Constraints:
- Consistent palette of 16 colors, hard pixel edges, no anti-aliasing.
- Character centered in every cell, feet aligned to the bottom of each cell.
- No outlines, no drop shadow, no background, no text, no watermark.
- Same proportions and silhouette in every frame.
Output: single PNG, transparent background.
Generate a seamless side-scrolling tileset, 16-bit pixel art, side view.
Tile size: 32x32. Include:
- ground top, ground fill, ground left and right edges
- platform, 3 widths
- slope, 2 directions
- background brick, 1 variant
Then generate 3 parallax layers, each seamless horizontally, 1920x540, transparent where needed:
- far layer: mountains
- mid layer: forest
- near layer: bushes
Constraints:
- Palette: <daftar hex, misal #1a1c2c #5d275d #b13e53 #ef7d57>
- Hard pixel edges, no anti-aliasing, no text, no watermark.
- Tiles must tile without visible seams.
Compose a looping chiptune BGM.
- 8-bit, 120 BPM, 4 bars, key A minor.
- Structure: 1 bar intro, 2 bars main loop, 1 bar turnaround.
- Must loop seamlessly: no fade in, no fade out, no silence at the edges.
- Instruments: square lead, triangle bass, noise percussion.
Then generate 6 SFX, short and mono, no reverb:
- jump, double jump, coin, hit, power-up, level complete
- Each 0.1 to 0.6 seconds, normalized loudness, no clipping.
1. Brief: write the game in one paragraph plus its win condition.
2. Reference: generate one concept image before writing any code.
3. Plan: split it into phases in TASKS.md, one checkbox per change.
4. Scaffold: engine boilerplate only, no gameplay yet. Confirm it runs.
5. Core loop: player, input, collision, camera. Ship it broken-but-playable.
6. Content: levels, enemies, progression.
7. Polish: audio, HUD, screens, transitions.
8. Deploy: static build to a host, then share the URL.
Rule of thumb: if a step cannot be verified by pressing play, it is not done.
Use two tiers of model per task.
- Planning tier: a reasoning-heavy model for architecture, state machines,
level systems, and debugging dead ends. Slower, higher quality.
- Execution tier: a fast model for mechanical edits, boilerplate, asset wiring,
and repetitive refactors.
Context discipline:
- One task per session. Paste only the files involved.
- Keep AGENTS.md and TASKS.md in context at all times; they are the contract.
- When usage runs out mid-task, stop and write the blocker into TASKS.md.
Do not let the agent guess at the missing context.