Game modes

Sandbox’s seven modes: race, platformer, arena, runner, explore, capture the flag and tower defense. Controls, win conditions, settings and required entities.

The mode is a game’s first decision. It provides the player controller, the camera, the score and the win conditions. You can switch it at any time without losing the world: the same terrain and entities become another game.

Overview

ModeIDWinLossCamera
RaceraceFinish 1st after the lapsFinish behind a botFollow
PlatformerplatformerReach the finishOut of livesFollow, orbitable
ArenaarenaClear every waveOut of HPFixed top-down
RunnerrunnerNone: distanceOut of livesBehind
ExploreexploreFinish, or collect everythingNoneFollow, orbitable
Capture the flagctfN capturesN enemy capturesFollow, orbitable
Tower defensetowerHold every waveBase destroyedOrbits the base

AZERTY keyboards

The runtime reads the W A S D characters and the arrow keys. On an AZERTY keyboard the arrows are therefore the reliable way to move; the tabs below give both layouts.

Race

Karts, checkpoints, laps and drift. Bots follow your checkpoint line.

ActionKeys
Throttle / brakeWS
SteerAD
DriftShift
Reset to last checkpointR

checkpoint entities are crossed in params.order order; a lap counts when you cross the finish after every checkpoint. Bots (0 to 7) steer toward the next checkpoint with a little noise. Off the road (road terrain colours), grip drops to 62 %. boost pads: full speed for 1.4 s. hazard: spin-out. Coin: short boost.

Platformer

Run, jump, collect coins, dodge hazards, reach the finish.

ActionKeys
Move (camera relative)WASD
Jump (hold for higher)Space
Orbit the cameraDrag
Back to checkpointR

Jumping has coyote time and an input buffer, with height depending on how long you hold. Enemies are stomped from above; side contact, a hazard or a fall cost a life and send you back to the last checkpoint. Score: 100 per coin, 150 per enemy, 1,000 at the finish, a time bonus and 50 per life left.

Arena

Top-down waves of enemies. Survive, shoot, score.

ActionKeys
MoveWASD
AimMouse
FireClickSpace

Placed enemies form wave 1. Each following wave n spawns 3 + 2n enemies at the spawn points (or where the placed enemies stood), faster and tougher. Coins restore 1 HP, solid props stop bullets. 2.5 s break between waves.

Runner

Endless lanes, obstacles and coins, ever faster.

ActionKeys
Change laneAD
JumpSpaceW
Drop fasterS

The player runs along the map’s Z axis. At the end they loop back to the start, 1.2 faster, and coins and boosts come back. Hitting a solid prop, a hazard or an enemy costs a life. Score: distance in metres, 10 per coin, 200 per loop.

Explore

A world to walk through. Collect what you placed, talk to NPCs, no fail state.

ActionKeys
WalkWASD
Jump / swim upSpace
Read, talk, activateE
Back to startR

No countdown and no lives. Signs (text) are read with E, enemies shove without hurting, hazards send you back to the last safe ground. With no finish, collecting every coin ends the walk.

Capture the flag

Two teams, two bases, one flag each. Bring theirs home, keep yours.

ActionKeys
MoveWASD
JumpSpace
Back to baseR

You play red; placed enemies are blue bots that steal your flag and hunt your carrier. Contact with a bot hurts you and drops the flag you carry. You only score while your own flag is home. See Flags and bases.

Tower defense

Waves walk the waypoints toward your base. Build turrets on the way.

ActionKeys
Build a turretClick
Turn the cameraQE

Turrets cost gold, earned by killing enemies and holding waves. Formulas and setup in Waypoints and tower defense.

Mode settings

These fields live in doc.rules and are set on the Rules step, Game section. Each mode only reads the ones that concern it.

lapsnumberDefault 3
Race: number of laps.
botsnumberDefault 3
Race: AI drivers, 0 to 7.
livesnumberDefault per mode
Lives (platformer 3, runner 1), HP (arena 3, CTF 3) or base health (tower defense 10).
wavesnumberDefault 5 / 8
Arena (5) and tower defense (8): number of waves.
lanesnumberDefault 3
Runner: lanes, 1 to 7.
coinsToWinnumberDefault 0
Platformer and explore: coins required before the finish counts; 0 = none.
timeLimitnumberDefault 0
Seconds before a “Time is up” loss, in every mode; 0 = none.
speednumberDefault 1
Player speed multiplier.
gravitynumberDefault 24
Gravity (units / s²).
jumpHeightnumberDefault 1
Jump height multiplier.
camera'third' | 'first' | 'top' | 'side' | 'fly'Default 'third'
Camera of follow modes. fly lets the player fly (Space up, Shift down). Arena stays top-down.

Game settings (settings.duration, settings.win) layer on top, see Variables and HUD.

Required entities

The “What’s missing” list, in the top bar and on the Publish step, checks a few things before allowing publication. Others are not blocking but the mode does not work without them.

ModeChecked at publishNeeded to play
AllTitle, player start, cover—
RaceA finish or checkpointsNumbered checkpoints for the bots
ArenaAt least one enemySpawn points recommended
Capture the flag—One flag and one base per team
Tower defense—Waypoints, base, one template enemy, one turret
Platformer, Explore—A finish (otherwise, in explore, the coins)

Start from a template

Every mode has a complete, playable template showing the expected setup. See Templates.