VIBEGAMES
BETA
My ProjectsMy Games
Getting Started
Game in 10 minutesCore conceptsScripting
AI Setup
Getting Started

Core concepts

Scenes, objects, components, scripts, physics, assets, materials, and variables — the model behind every Vibe Games project.

If you built Roll-a-Ball, you already used most of the ideas on this page. Here's the vocabulary so the editor and the docs make sense.

The model splits in two:

Per-object building blocks — a scene holds objects; each object is a bag of components plus any scripts.

Project-level resources — assets, materials, and variables live on the project, not on a single object. Any scene or object can pull from this shared pool.

Scene

A scene is one self-contained world — its objects, lights, camera, and background. A project can have several scenes (a menu, a level, a game-over screen) and switch between them at runtime with ctx.send("scene:switchTo", { sceneId }). Roll-a-Ball used a single scene.

Object

An object is a single thing in the scene: the ball, a wall, a pickup, the camera, a light, a piece of UI. Objects can be nested — an object can have child objects that move with it.

Every object has:

  • a name (what you see in the Hierarchy) and a unique id
  • a set of components (below)
  • zero or more scripts

Component

Components are the capabilities you bolt onto an object. An object with a mesh is visible; add physics and it collides; add light and it lights the scene. You mix and match them in the Inspector with Add Component.

The main ones:

ComponentWhat it does
transformPosition, rotation, and scale. Almost every object has one.
meshA visible shape — box, sphere, cylinder, terrain, imported 3D models, and more. Wears a material.
physicsMakes the object collide, fall, or act as a trigger. See Physics.
cameraRenders the scene from this object's point of view.
lightA light source (ambient, directional, point, spot, hemisphere).
uiOn-screen or in-world interface — text, buttons, images.
audioPlays a sound from an audio asset.
particleEmits particles.
backgroundThe scene's backdrop — a flat color or a skybox (lives on the scene itself).

In Roll-a-Ball the ball had transform + mesh + physics; the score readout had a ui component.

Script

A script is JavaScript attached to an object. The engine calls three optional functions: init() once at start, update() every frame, and onMessage(message) when the object receives an event.

/** @type {ScriptUpdate} */
function update() {
  // runs ~60 times a second — movement, input, game logic
}

The functions take no ctx parameter — ctx is a global that's always available, your handle to input, time, the scene, other objects, variables, and messaging.

Scripting reference

The full lifecycle, the ctx global, reading input, moving objects, and JSDoc fields.

Physics

Add a physics component and an object joins the simulation. The key setting is Body Type:

  • Fixed — never moves. Floors, walls.
  • Dynamic — fully simulated; falls and responds to forces. The ball.
  • Kinematic — moves only when a script drives it, by position (kinematicPosition) or by velocity (kinematicVelocity). Moving platforms, character controllers.

Scripts push bodies around by sending messages:

ctx.send("physics:applyForce",         { objectId, force });
ctx.send("physics:applyImpulse",       { objectId, impulse });
ctx.send("physics:setLinearVelocity",  { objectId, velocity });
ctx.send("physics:setAngularVelocity", { objectId, velocity });
ctx.send("physics:teleport",           { objectId, position });

Triggers and collisions

Turn on Trigger and an object stops blocking things but reports when something enters it. The engine delivers these to onMessage:

Message typeFires when…
physics:onTriggerEnterA body enters a trigger volume.
physics:onTriggerExitA body leaves a trigger volume.
physics:onCollisionEnterTwo solid bodies start touching.
physics:onCollisionExitThey stop touching.

Each carries payload.source (the object the script is on) and payload.other (what it touched). That's how the Roll-a-Ball pickup knew the ball had reached it.

Assets

An asset is any external file your project uses — uploaded, generated, or pulled from the library. They live in the Assets panel and come in four kinds:

KindExamplesUsed by
ImagePNG, JPG, SVG, WebPui images, material textures
AudioMP3, WAV, OGGthe audio component
ModelGLB, OBJ, FBXa mesh of type "model"
BackgroundHDR, EXRthe scene background

Objects never embed a file directly — a component references an asset by id. Upload a model once and any number of mesh components can point at it.

Materials

A material is a reusable surface definition — what a mesh looks like. They live in the Materials panel, so you can define a look once and reuse it across objects. Four types:

  • Standard — physically based: color, metallic, roughness, opacity, optional texture and emissive.
  • Basic — unlit flat color (and optional texture). Cheap, ignores lighting.
  • Emissive — self-illuminating color with an adjustable strength.
  • Custom Shader — your own GLSL vertex and fragment shaders.

A mesh component references a material by id and can add per-instance overrides — tweak the color or roughness on one object without touching the shared material.

Textures tie the two resources together:

image asset → material texture → mesh that wears the material

Variables

ctx.variables is a shared store any script can read or write. It's how separate objects coordinate without knowing about each other — the pickup wrote ctx.variables.score, and the HUD read it:

// pickup
ctx.variables.score = (ctx.variables.score ?? 0) + 1;

// HUD, every frame
ctx.entity.components.ui.text = "Score: " + (ctx.variables.score ?? 0);

Recap

Build Roll-a-Ball

See every concept in action — steer a ball, collect pickups, score, and publish.

Scripting reference

Go deeper on scripts — the ctx global, input, time, and messaging.

Game in 10 minutes

Build Roll-a-Ball — steer a ball with the keyboard, collect pickups, track a score, and publish it.

Scripting

The script lifecycle, the ctx global, and how to read input, move objects, and find things in the scene.

On this page

SceneObjectComponentScriptPhysicsTriggers and collisionsAssetsMaterialsVariablesRecap

Vibe Games

© 2026 Vibe Games. All rights reserved.

Quick Links

  • Browse Games
  • Create Game
  • Documentation
  • Pricing

Community

  • Discord
  • GitHub

Legal

  • Privacy Policy
  • Terms of Service