Project Setup
Organizing Files and Directories
We recommend setting up your project directory as follows:
- package.json
- README.md
- vite.config.js
- tsconfig.json
- index.html
Directorysrc
- index.css
- index.ts
- Application.ts
Directoryassets static assets like fonts, images, and audio
- …
Directorystates where your game states are stored
- SplashScreen.ts
- IntroScreen.ts
- GameScreen.ts
- HighScoresScreen.ts
- …
Build Tools
To develop your game locally and build it for production, you’ll need to configure a build process. We recommend using Vite, a blazing fast build tool that supports modern JavaScript features.
Create a vite.config.js
file in the root directory to configure the build process. The default Vite configuration
is sufficient but for handling static assets we’re using the vite-plugin-static-copy
so that they can be loaded from within the game. You can configure the plugin
however you like based on how you’ve organized your assets.