Project structure
Keep a small project easy to open and change. Split files as the game grows:
my-game/
├── index.html
├── src/
│ ├── main.js
│ ├── game.js
│ └── styles.css
└── assets/
├── images/
└── audio/index.html is the entry. main.js initializes the game and input; game.js owns state and updates; styles.css owns layout. Keep images and audio in assets.
Use relative asset paths such as ./assets/images/target.svg, avoiding files that exist only on your machine. Keep score, time, and phase in a shared state model and render the UI from it. For bundlers, inspect the generated output and paths. The integration guide defines what to upload.
Last updated on