Getting Started

Quick Start

Create your first single-player or multiplayer browser game with MavonEngine, the Three.js game engine.

Single-player setup

The minimum setup for a single-player Three.js game requires a Game instance.

import { Game } from '@mavonengine/core'

const game = new Game()

Game is a singleton. Call Game.instance() to get the instance. It automatically:

  • Creates a <canvas> and appends it to the document
  • Sets up the WebGL renderer, perspective camera, and audio listener
  • Starts the render loop via requestAnimationFrame
  • Initializes physics (Rapier3D) and the input manager

Multiplayer setup

For multiplayer, the server runs BaseGame headlessly and clients run Game. See the Networking section for the full setup.

Development mode

Append #debug to your URL to enable the debug panel (Tweakpane). In dev mode, the engine also activates the in-editor overlay.

http://localhost:3000/#debug

Next steps