Skip to content

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.

  1. Create the project.

    Terminal window
    npm create dacha@latest my-game

    Leave 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.

  2. Install dependencies.

    Terminal window
    cd my-game
    npm install

    Expect this one to take a few minutes. dacha-workbench builds its desktop application on install. Later installs in the same project are quick.

  3. Start the game.

    Terminal window
    npm run dev

    Open the address Vite prints. It is http://localhost:5173 unless the port is taken. A player sprite stands on a grass field. WASD moves it.

Leave the dev server running and open a second terminal:

Terminal window
npm run editor

The 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.

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