Creating with the CLI12 / 12

Creating an empty project

Create with gamedevland create, run the project and explore its files.

Node.js 22.12+ and npm are required. Open a terminal in the directory that holds the projects and run:

npx --yes --package @gamedevland/vite gamedevland create sdk-game
cd sdk-game
npm run dev

npx downloads the tools, and gamedevland create sdk-game creates the directory and installs the SDK and dependencies. The name sdk-game can be changed; the directory must be new or empty. cd sdk-game enters the project, and npm run dev starts Vite. Open the address printed in the terminal to see a dark canvas with an empty main scene.

To create files without installing dependencies, add --no-install, then run npm install inside the project later.

Project files

The template selects PixiRendererModule and imports from @gamedevland/engine/renderers/pixi. It already includes configuration, DI, a JSON layout and an FSM with one ready state. The files are ready for game logic:

game/src/main.tsCalls Engine.run with the GameConfiguration config.
game/src/config/GameConfiguration defines the screen, assets and scenes; ProjectDi and ProjectGlobalDi register dependencies.
game/src/scenes/main/MainScene is the empty scene; MainSceneDefinition sets its layout and FSM, and MainSceneDi defines scene dependencies.
game/assets/json/The empty scene layout and sounds-volumes.json with music and effects volumes.
At the root: package.json holds dependencies and commands; vite.config.ts configures the build; tsconfig.json and eslint.config.js configure code checks.

Press Ctrl+C to stop the server, then check types, code style and the build:

npm run typecheck
npm run lint
npm run build

Build output appears in dist/.

Course curriculum →