Installation
By the end of this page you have a playable game running in a browser tab, and the editor open against the same project.
Scaffold the project
Section titled “Scaffold the project”-
Create the project.
Terminal window npm create dacha@latest my-gameLeave the name off and it asks for one. The command runs
create-dacha, which writes a small, complete game you then change into your own. The documentation calls it the starter project. -
Install dependencies.
Terminal window cd my-gamenpm installExpect this one to take a few minutes.
dacha-workbenchbuilds its desktop application on install. Later installs in the same project are quick. -
Start the game.
Terminal window npm run devOpen the address Vite prints. It is
http://localhost:5173unless the port is taken. A player sprite stands on a grass field. WASD moves it.
Open the editor
Section titled “Open the editor”Leave the dev server running and open a second terminal:
npm run editorThe editor starts as its own desktop application and loads the project it was launched from. Two things are now running: the game, served by Vite, and the editor, pointed at the same directory.
That is the working setup. Change something in the editor, then look at the browser tab.
What you got
Section titled “What you got”The scene has three actors: a camera, the player, and a tiled background. The movement is a
component and a system in src/game/, written the same way your own will be. Change it
rather than read it.
Everything the editor writes lives under data/. Everything you write lives under src/.
Project structure walks the tree in full.
| Script | What it does |
|---|---|
npm run dev |
Vite dev server |
npm run editor |
The editor, against this project |
npm run build |
Production build into dist/ |
npm run preview |
Serve the production build |
npm run typecheck |
tsc --noEmit |