Play here and test
Play the map inside the editor, use cheats, save test points, edit the map while it runs, watch replays, and run your project's scripts.
Play the map here
- Press ▶ in the top bar (or Ctrl+P).
- Pick who you play as, and fog on or off, in the Play menu.
- While it plays: Ctrl+Shift+P pauses, Ctrl+Alt+P steps one tick, Ctrl+P (■) stops and returns to the map as it was.
If the map is a project file with unsaved changes, Play writes the file first. The game plays with its own play scene, from where the view is. A map with an error in Problems does not start.
While it plays, the Hierarchy lists everything in the running world, the Inspector shows what you select live (change a number in place), and the Console shows what the game says.
Play (Ctrl+Enter) instead saves the map and opens the game's play scene with its menus.
Use cheats
- Play the map here: the Cheats panel (the wand on the right rail) appears.
- Click a cheat, or press its key (Alt+Shift and a letter, over the game).
| Cheat | Key | In code (editor.played.debugTools) |
|---|---|---|
| No fog for your team | Alt+Shift+R | reveal(on), revealed |
| Invulnerable: what you own takes no harm | Alt+Shift+I | cheat('invulnerable', on) |
| No cooldowns, no mana costs | Alt+Shift+C, M | cheat('noCooldowns' | 'noManaCosts', on) |
| Resources, experience (as much as the panel says) | Alt+Shift+G, H | giveResources(amount), giveExperience(amount) |
| An hour later | Alt+Shift+T | setHour(hour) |
| Speed: paused to 8× | Alt+Shift+= and - | played.speed |
| Spawn a unit type, for whom, how many | Alt+Shift+S | setSpawnTool({ player, unitType, count }) |
| An item for the selected unit | Alt+Shift+B | giveItem(item, entities?) |
| Selected heroes to a level, or a level up | Alt+Shift+J, U | setLevel(level, entities?), levelUp(entities?) |
| Win, lose | Alt+Shift+W, X | win(), lose() |
In a game with grass (foliagePack), Grass has four brushes: Ignite, Extinguish, Cut and Regrow. Pick one and its reach, then click or drag over the game's map; Esc lets it go. Wind sets how strong the wind blows and where towards, for everyone. Each is a debug command (debug.foliage, debug.wind), so replays hold it. See Grass and bushes in the editor.
Spawn arms the game's spawn tool: the next click on the game's map puts the unit down (Shift keeps placing, Esc stops). The game must allow its debug tools (debug: true).
Save a test point and play from it
- While the map plays, reach the moment you want (before the boss, the third wave).
- Press Ctrl+Shift+S, or Save here in the Cheats panel's Test points, or Play › Save a test point.
- Later, pick Play from in the Play menu (or the button beside the point) to start from there.
A test point is saved in the map's own files as tests/<name>.save.json, named by the time (2m05s) or what you type. It holds the whole ground, so it still plays after you edit the map's ground; things placed since are not in it.
Fast-forward to a moment
- Open Play › Play to….
- Pick a time (seconds), an objective given, done or failed, or a wave sent by a computer player.
- The game runs as fast as the page can, then pauses there. Stop leaves it paused where it got to.
It gives up if the game ends first, or after an hour of game time.
Edit the map while it plays
- While playing, change the map: place, move or delete units, paint, raise the ground.
- Each change goes into the running game at once.
- Press Ctrl+Shift+E to see the map in the game's place (the game keeps running), and again to go back.
A style of grass changed in the Terrain panel (its name, colour, Gameplay) goes into the game at once, whether edits are pushed or not: grass that stops hiding shows who stands in it.
Things dropped from Place or Content onto the game itself go onto the map and into the game. Regions, points, paths, cameras, scenery, camps, players and map settings are read only when the world is made: play again for those. Push map edits into the game in the Play menu turns this off.
Watch a replay
Every game played here for more than ten seconds is recorded into the map's files as replays/<date>.json (kept out of git).
- Open Play › Replays.
- Pick one: it plays in the game's place with the replay bar (hold, step, faster, slower, jump).
- Press Ctrl+P to go back to the map.
Edits and cheats made while it played are in the replay, so it plays back the same.
Run the project's scripts
- List the scripts the editor may run in your
vite.config:editorFiles({ run: ['dev', 'server', 'app:editor'] }). - Open the Run panel (left rail).
- Press start or stop beside a script. Its last lines show there, and all of them in the Console.
Stopping a script stops everything it started. All of them stop with the dev server. A desktop project has app:editor, which opens the desktop shell on the dev server the editor runs on.
Open the game in a tab
- In the Run panel, press Open the game and pick a scene and a map.
- The panel lists the open tab with its scene and frames a second (quiet after five seconds of silence).
- Close it with its ✕.
Make a play scene for editor maps
The scene the editor's Play button opens is your game's mapPlayScene:
export const towerDefenseOnMap = mapPlayScene({
id: 'td-map',
name: 'Tower defense, on a map of the editor',
rules: towerDefense,
view: towerDefenseView,
editor: 'td-editor',
player: () => DEFENDER,
onStart: (world) => startTowerDefense(world)
})With saves, the HUD saves and loads: a load opens the scene again from the save, runs the game's afterLoad (not start), and seats the computer players again.
In code
editor.plays.playOrStop()
editor.plays.pausePlay(true)
editor.plays.stepPlay(1)
editor.playState // 'stopped' | 'starting' | 'running' | 'paused'
editor.played // the game's client while it plays
await editor.plays.saveTestPoint('boss')
await editor.plays.playFrom('boss')
editor.plays.playTo({ objective: 'td.hold', status: 'done' })
editor.plays.showMap(true)
editor.plays.watchReplay('2026-10-29-0715')
await editor.run.start('server')
editor.run.openGame({ scene: 'td-map', map: 'road' })Reference
Play here
| API | What it does |
|---|---|
editor.plays.playOrStop(), pausePlay(paused?), stepPlay(ticks?) | Play, pause, step (a game played in the page, LocalSession) |
saveTestPoint(name?), testPoints(), testPoint(name), playFrom(name), removeTestPoint(name) | Test points |
playTo(until), stopPlayingTo(), playingTo | PlayTo: { time }, { objective, status?, player? }, { wave, player? } |
pushEdits(), pushingEdits, showMap(on?), mapShown, followEdits() | Edits while it plays |
replays(), replay(name), watchReplay(name), watching, keepReplay(replay), removeReplay(name) | Replays |
editor.testComputer(player) | Play with the Inspector on a computer seat |
- Test points are the engine's save (
saveWorld), loaded withloadWorld. One made with other rules is the game's to refuse (Rules.saves.onMismatch). - Play to runs
LocalSession.runUntil(until, { most, deadline }), 40 ms of each frame. - Edits go in as debug commands (
debug.mapObject,debug.place,debug.unplace,debug.ground), so replays hold them. A layer's styles go in whole asdebug.cellStyles(plays.pushStyles()); the grass brushes and the wind asdebug.foliageanddebug.wind(editor.grassBrush.arm({ act, layer, radius }),setPlayedWind(editor, { strength, around })).mapPushCommands(before, after, registry)makes them. The engine reshapes the ground withworld.reshapeGround(patch)andNavigation.reshape();world.fromMapmaps each map object to its entity. - Decals changed while playing go to the screen only (
client.setEnvironment({ decals })). - Paths:
testPointPath,isTestPointPath,testPointsIn(pack),replayPath,isReplayPath,replaysIn(pack),replayName(date). - A page's own shell plays with
shell.playHere(from)andshell.watchReplay(replay, name)(the client'swatchReplay(replay, { game, canvas, overlay })).
Run panel
| API | Dev server |
|---|---|
editor.run.load(), scripts(), start(script), stop(script) | GET, POST, DELETE __editor/run |
editor.run.openGame({ scene, map }), games(), closeGame(id) | /?run=<id>&scene=<id>&map=<name> |
The __editor/run routes answer only a connection from this machine with a localhost Host and a same-origin Origin, so a web page cannot start a script. POST takes { "script": "<name>" } from the project's list and nothing else. A page with its own shell reports itself to the panel with watchRun(id, scene). None of this is in a built page.