Create a game
Start a new IFLoom game with npm create ifloom, choosing a package manager, a template and a theme.
Use this to start a new game in a folder of its own, with npm, pnpm, yarn or bun. You need Node 20.19 or later, or 22.12 or later. To put a game in a project you already have, see Add IFLoom to an existing project instead.
Make the game
-
Run the create command with the folder name you want:
npm create ifloom@latest my-game cd my-game npm install npm run dev -
Open the address the dev server prints. The page reloads each time you save a file.
The command makes a two-scene game in my-game, installs nothing itself, and prints the next commands for the package manager you ran it with. The name must be a valid npm package name, and the folder must be new or empty.
Pick a template
Add --template to start from something other than the React UI. With npm, put the flags after --, as in npm create ifloom@latest my-game -- --template vue. pnpm, yarn and bun take them as they are.
react, the default, renders the game with the React UI and opens on a title screen.vanillaandvuerender the same game with your own code, in plain DOM or Vue 3 components.sveltedoes the same with Svelte 5.nextputs the game in a Next.js app. See Build with Next.js.novel,cafeandtowncopy the examples The Letter, The Corner Café and the showcase, Small Town, without their tests and recorded runs.pluginmakes a plugin package to publish on npm. See Write a plugin.
Choosing a UI compares the React UI with a UI of your own, and Three shapes of game describes the three examples.
Start from every plugin at once
The town template is the showcase, with every first-party plugin in its plugins list and its React UIs wired up. Copy it to see how a game with places, people, a calendar and a shop fits together:
npm create ifloom@latest my-town -- --template townPick a theme
A react or next game gets one of the React UI's four presets at random, and the command prints the one it picked. Choose one with --theme paper, terminal, studio or storybook, or --theme none for the plain look. The command writes it into src/styles.css, where you can change it later. A copied example keeps its own theme unless you pass one, and the other templates ignore the flag.
Check it worked
Stop the dev server, or open a second terminal, and run the game's checks:
npm run check
npm run typecheckcheck prints No problems. for a game that loads cleanly, and typecheck prints nothing. With yarn 2 or later, the command also writes a .yarnrc.yml with nodeLinker: node-modules, because Vite doesn't support Plug'n'Play installs.
The new game's files follow Organise your game's files, and its AGENTS.md briefs a coding agent (see Work with a coding agent). For more, see:
ifloom new, every flag of the commandnpm create ifloomruns.- The story tutorial, which writes a short branching story, with no plugins, in four steps.
- The town tutorial, which builds a game with places, people and time, step by step.
- Run the examples from the repository, to try unreleased code.
Last updated on