Lab Documentation

Complete 2D documentation for the BYR programming language and Lab environment

Getting Started

The lab is the powerful tool used for developing video games.

Basic Setup

To get started, simply open the Workspace, select/create a project, and begin writing your code.

Running Your Code

Click the button in the top bar to execute your code. The output will appear in the preview panel on the right.

Game Objects

Create game objects using the GameObject function.

All game objects share a common set of properties and methods, such as position, rotation, etc.. Additional properties may apply depending on the object type.

Circle

new GameObject("Circle");

Rectangle / Rect

new GameObject("Rectangle");

Square

new GameObject("Square");

Triangle

new GameObject("Triangle");

Capsule

new GameObject("Capsule");

Sprite

Create animated sprites using the GameObject function.

Syntax

new GameObject("Sprite");

Sprite Object Methods

MethodDescriptionParameters
playAnimation(name, options)Play animationname: String, options: Object
pause()Pause animation-
resume()Resume animation-
stop()Stop animation-
setFrame(frame)Set specific frameframe: Number
setFPS(fps)Set animation speedfps: Number
getCurrentAnimation()Get current animation→ String
getCurrentFrame()Get current frame→ Number
isPlaying()Check if playing→ Boolean

Text

Create text elements using the GameObject function.

Syntax

new GameObject("Text");

Text-Specific Properties

Property Type Default Description
text String "" The text content to display
fontSize Number 16 Font size in pixels
font String "Arial" Font family
color String "#ffffff" Text color
backgroundColor String "transparent" Background color
dynamic Boolean true Whether text can move

Text Object Methods

MethodDescriptionParameters
updateText(newText)Update text contentnewText: String
setColor(color)Change text colorcolor: String
setBackgroundColor(color)Change background colorcolor: String
setFontSize(size)Change font sizesize: Number

Audio

Create audio objects using the GameObject function. For attached audio objects, the analyser is created automatically, so you can use getFrequency() and getWaveform() immediately without any setup.

Syntax

new GameObject("Audio");

Audio Object Methods

MethodDescriptionParameters
play()Play audio-
pause()Pause audio-
stop()Stop audio-
setVolume(volume)Set volume (0-1)volume: Number
setLoop(loop)Set loopingloop: Boolean
seek(time)Seek to timetime: Number
setAudioSource(src)Change audio sourcesrc: String
onLoad(ƒn)Callback for when the audio has loadedcallback: ƒn
onEnd(ƒn)End of playback callbackcallback: ƒn
onError(ƒn)Error callbackcallback: ƒn
onPlay(ƒn)Playback start callbackcallback: ƒn
onPause(ƒn)Pause callbackcallback: ƒn
getDuration()Get audio duration-
getCurrentTime()Get current time-
isPlaying()Check if playing-
isPaused()Check if paused-
hasEnded()Check if ended-
attachTo(gameObject)Attach audio to a GameObjectgameObject: GameObject
fadeVolume(targetVolume, duration)Smoothly fade volume over timetargetVolume: Number, duration: Number
crossfadeTo(otherAudio, duration)Crossfade to another audiootherAudio: GameObject, duration: Number
getFrequency() Get frequency spectrum data as bass, mid, and/or treble-
getWaveform()Get waveform amplitude (0-100)-

Video

Create video objects using the GameObject function.

Syntax

new GameObject("Video");

Video Object Methods

MethodDescriptionParameters
play()Play video-
pause()Pause video-
stop()Stop video and reset to beginning-
setVolume(volume)Set volume (0-1)volume: Number
setLoop(loop)Set loopingloop: Boolean
setVideoSource(src)Change video sourcesrc: String

WebView

Create a webview object that displays embedded web content.

Syntax

new GameObject("WebView");

Properties

PropertyTypeDefaultDescription
channel String - Channel name (Twitch) or video ID (YouTube)
videoId String - Alternative to channel for YouTube video IDs

Constraint

Create constraints between two GameObjects.

Syntax

new GameObject("Constraint");

Constraint Types

  • distance - Fixed distance between two points (View Demo)
  • revolute / revoluteJoint - Hinge/pivot joint (View Demo)
  • spring - Spring with stiffness and damping (View Demo)
  • weld - Rigid connection (View Demo)
  • mouse - Mouse control constraint (View Demo)

Constraint Properties

PropertyTypeDefaultDescription
type String "distance" Constraint type
bodyA Body - First body to connect
bodyB Body - Second body to connect
pointA Object {x:0, y:0} Offset from bodyA's center
pointB Object {x:0, y:0} Offset from bodyB's center
length Number Auto Target distance (distance/spring constraints)
stiffness Number 0.1 Spring stiffness (spring constraint)
damping Number 0.01 Spring damping (spring constraint)
visible String "none" Constraint visibility
breakForce Number - Force threshold that automatically breaks the constraint

Constraint Methods

MethodDescriptionParameters
setLength(newLength)Set new distance length (distance constraints only)Number
setStiffness(newStiffness)Set spring stiffnessNumber
setDamping(newDamping)Set spring dampingNumber
break()Break the constraint-

Game Object Properties

PropertyTypeDefaultDescription
positionObject{x: 0, y: 0}Object position in the scene
rotationNumber0Rotation in radians
velocityObject{x: 0, y: 0}Current linear velocity
angularVelocityNumber0Current angular velocity
colorString"white"Fill color
dynamicBooleanfalseWhether object can move
frictionNumber0.1Surface friction level (0-1)
restitutionNumber0.8Bounciness of object (0-1)
scaleObject{x: 100, y: 100}Object size (width and height)
widthNumber-Width of the object
heightNumber-Height of the object
radiusNumber-Radius
nameString-Unique identifier

Game Object Methods

These methods allow you to control and manipulate 2D objects.

MethodDescriptionParameters
applyForce(force)Apply force to object{x, y}
setVelocity(velocity)Set linear velocity{x, y}
setAngularVelocity(value)Set angular velocityNumber
setPosition(position)Set object position{x, y}
setRotation(angle)Set rotation angleNumber (radians)
setScale(scaleX, scaleY)Scale objectNumber, Number
destroy()Remove object from scene-
setColor(color)Change object colorString
distanceTo(target)Calculate distance to another objectGameObject → Number
directionTo(target)Get normalized direction to another objectGameObject → {x, y}
lookAt(target)Rotate to face another objectGameObject
wrapEdges(scene, padding)Wrap around scene edgesScene, Number
unwrapEdges()Disable edge wrapping-
setWireframe(enabled)Toggle wireframe renderingBoolean
setGravity(x, y)Set custom gravity for this objectNumber, Number
clearGravity()Reset object to scene gravity-
spin(props)Make object spin continuously{ speed, reverse }
stopSpin()Stop the spinning-
setRelativeMovement(enabled, bindings/speed)Enable movement for objectBoolean, Object

Note for setRelativeMovement:

  • Use "WASD" or "Arrows" for default keybindings (View Demo)
  • Customize keys with an object: { up: "i", down: "k", left: "j", right: "l" } (View Demo)
  • Movement modes:
    • continuous (default) — Hold key for smooth, continuous movement (View Demo)
    • impulse — Move instantly on key press/tap to move (View Demo)
    • force — Physics-based acceleration (gradual speed change) (View Demo)
  • Requires importing the RelativeMovement module first

Note for wrapEdges:

Use portal: true to make the object appear on both sides of the screen when crossing edges.

Event System

The event system allows game objects to communicate and react to custom actions. You can listen for events using on() and trigger them using trigger().

Syntax

gameObject.on([event], [ƒn]);
gameObject.trigger([event], [eventData]);

Event Methods

MethodDescriptionParameters
on(event, ƒn) Listen for an event String, Function
trigger(event, eventData) Trigger an event String, Any
off(event) Remove event listeners String

Keyboard

The Keyboard module allows you to handle key presses, holds, releases, and key combinations with full control over timing and context.

Access

To access the Keyboard functionality, make sure you import it.

Keyboard Methods

Method Description Parameters
onKeyPress(keys, callback) Trigger callback when key(s) are pressed String/Array, Function
onKeyHold(keys, callback, duration) Trigger callback after holding key(s) for duration String/Array, Function, Number
onKeyRelease(keys, callback) Trigger callback when key(s) are released String/Array, Function
onComboPressed(combo, callback) Trigger callback when all keys in combo are pressed Array, Function
onComboHold(combo, callback, duration) Trigger callback after holding combo for duration Array, Function, Number
onComboReleased(combo, callback) Trigger callback when any key in combo is released Array, Function
enableContext(element) Restrict keyboard events to specific UI element UI Element
disableContext() Remove context restriction -
clearAll() Clear all handlers, timers, and key states -

UI System

The UI System allows you to create interactive user interface elements.

Available Elements

  • Button - Clickable button
  • Label - Text display
  • Panel - Container for other UI elements
  • Slider - Draggable range selector
  • ProgressBar - Visual progress indicator
  • Input / Textbox - Text input field
  • WebView - Embedded web content
  • Countdown - Countdown timer
  • Stopwatch - Stopwatch timer

Syntax

new UIElement(type, properties);

Adding to Scene

// Scene-specific UI (clears when scene changes)
button.addTo(scene);

Adding Globally

// Persistent UI (stays across all scenes)
button.add();

UIElement Methods

Method Description Parameters
addTo(scene) Add UI to a specific scene (scene-specific) Scene
add() Add UI as global (persists across scenes) -
setPosition(x, y) Set UI position Number, Number
setSize(width, height) Set UI size Number, Number
setText(text) Set text content String
setValue(value) Set slider or progress value Number
setColor(color) Set text color String
setBackgroundColor(color) Set background color String
setFontSize(size) Set font size in pixels Number
setStyle(style) Apply CSS styles Object
setCursor(cursorType) Set mouse cursor style String
on(event, callback) Add event listener String, Function
off(event, callback) Remove event listener String, Function
show() Show UI -
hide() Hide UI -
destroy() Remove UI -

UI Events

Event Description Applies To
click Triggered when UI is clicked button, slider
input Triggered when value changes slider, input
change Triggered when value is committed slider, input
focus Triggered when UI gains focus input
blur Triggered when UI loses focus input
mouseover Triggered on mouse enter all
mouseout Triggered on mouse leave all

WebView

Embed live web content directly in your UI.

Syntax

new UIElement("WebView");

Properties

PropertyTypeDefaultDescription
channel String - Channel name (Twitch) or video ID (YouTube)
videoId String - Alternative to channel for YouTube video IDs

Countdown

Syntax

new UIElement("Countdown", config).at(time, callback);
PropertyTypeDefaultDescription
timeString"05:00"Starting time in MM:SS format
themeString"default"Visual theme for the display
colorString-Countdown color
glowBrightnessNumber0.6Brightness multiplier for the glow effect (0-1)
intervalNumber1Update interval in seconds
sizeNumber50Font size in pixels
positionObjectCenter of canvasScreen position
onEndFunction-Called when countdown reaches zero
MethodDescription
at(time, callback)Execute callback at specific MM:SS. Chainable.
pause()Pause the countdown
resume()Resume the countdown
restart()Restart from initial time
.themeGet/Set the theme
destroy()Remove the countdown

Stopwatch

Syntax

new UIElement("Stopwatch", config).at(time, callback);
PropertyTypeDefaultDescription
themeString"default"Visual theme for the display
colorString-Stopwatch color
glowBrightnessNumber0.6Brightness multiplier for the glow effect (0-1)
sizeNumber50Font size in pixels
intervalNumber1Update interval in seconds
positionObjectCenter of canvasScreen position
MethodDescription
at(time, callback)Execute callback at specific MM:SS. Chainable.
pause()Pause the stopwatch
resume()Resume the stopwatch
restart()Reset to zero and continue
stop()Stop the stopwatch
.themeGet/Set the theme
destroy()Remove the stopwatch

Themes

29 visual themes available for Countdown and Stopwatch: default, neon, flaming, lux, retro, glowing, tacticle, news, candy, floating, 80s, distant, outline, love, inset, blocks, grave, solid, cartoon, vegas, comic, deep, mummy, hero, dracula, blurry, emboss, press, carve, ghost.

Themes with glow support: neon, flaming, glowing, vegas, hero, love, outline.

Collision System

The collision system allows you to detect and respond to interactions between game objects.

Creating a Collision

new Collision([objects]);

You can pass a single object or an array of objects to monitor collisions between them.

Collision Methods

Method Description Parameters
onStart(handler) Called when two objects start colliding Function(objA, objB)
onEnd(handler) Called when two objects stop colliding Function(objA, objB)
add(objects) Add more objects to the collision system GameObject / Array
destroy() Remove all collision listeners and stop tracking -

Automatic Events

Each object involved in a collision also automatically triggers event's:

[GameObject].on("collisionStart", (other) => { ƒn }); 
[GameObject].on("collisionEnd", (other) => { ƒn }); 

Hitbox

Hitboxes are invisible collision shapes that can be attached to GameObjects for precise collision detection.

Syntax

new Hitbox(shapeType, properties);

Shape Types

Hitbox Methods

Method Description Parameters
attachTo(gameObject, options) Attach hitbox to a GameObject GameObject, {offset}
on(event, callback) Add event listener String, Function
off(event, callback) Remove event listener String, Function

Properties

Property Type Default Description
position Object {x: 0, y: 0} Position
width Number 50 Width
height Number 50 Height
radius Number 25 Radius
dynamic Boolean true Whether hitbox can move
visible Boolean false Visibility
trigger Boolean false If true, detects collisions without physical response
canCollide Boolean true Whether hitbox participates in collisions

Scene

Access scene properties and methods for responsive positioning and sizing.

Methods

Method Description Returns
scene.size Returns the canvas dimensions Object {x, y}
scene.halfSize Returns half of the canvas dimensions Object {x, y}
scene.add(object) Add one or multiple objects to the scene void
scene.remove(object) Remove an object from the scene void
scene.clear() Remove all objects from the scene void
scene.count() Returns the total number of objects in the scene Number
scene.reload() Reloads the scene void

Note: to reload the entire project, use the engine.reload(); function.

Object Retrieval

Search and retrieve game objects in the scene using the flexible scene.query system.

Syntax

scene.query(query);

Query Formats

  • "name -> [name]" - Retrieve by custom name
  • "type -> [shape]" - Retrieve by object type
  • "index -> [number]" - Retrieve by creation order (1-based index)
  • "[query] -> [value][type:[shape]][idx:[number]]" - Filter by type and/or position

Camera

The 2D camera controls how the scene is viewed. You can create multiple cameras, switch between them, and apply visual effects.

Syntax

Default Camera
new Camera(name);

To activate or deactivate a camera, use the activate/deactivate method. BYR provides a default 2D camera accessible via camera, so you can use it directly without creating a new one.

Camera Properties

PropertyTypeDefaultDescription
position Object { x: 0, y: 0 } Camera's current position in the world
zoom Number 1 Current zoom level
border.visible Boolean false← Change from true to false Show/hide border around camera view
border.color String "#ffffff" Border color (e.g., "#ff0000", "red")
border.width Number 2 Border thickness in pixels
label.visible Boolean false← Change from true to false Show/hide label on camera view
label.text String camera name Label text content
label.color String "#ffffff" Label text color
label.font String "12px Arial" Label font style

Camera Methods

MethodDescription
activate() Activate this camera (make it the active camera for single-camera mode)
deactivate() Deactivate this camera (remove from rendering)
attachTo(target, smoothness) Attach camera to follow a target
panTo(x, y, duration, smooth) Pan camera to position
zoomTo(targetZoom, duration) Smoothly zoom to level
shake(intensity, duration) Camera shake effect
fade(color, duration, type) Fade in/out/in-out effect
setViewport(x, y, width, height, normalized) Set camera viewport region
setBorder(options) Set border options: { visible, color, width }
setLabel(options) Set label options: { visible, text, color, font }
destroy() Remove the camera

Layers

Layers allow you to organize game objects into groups for collective control.

Syntax

new Layer([gameObjects], options);

Properties

Option Type Default Description
welded Boolean false When true, objects move as a single rigid unit. Forces and velocities only affect the first object in the layer; the rest follow maintaining their relative positions.

Layer Methods

Method Description Parameters
add(objects) Add GameObject(s) to the layer GameObject / Array
remove(objects) Remove GameObject(s) from the layer GameObject / Array
commandAll(callback) Execute a function on all objects in the layer Function
clear() Remove all objects from the layer -
setGravity(x, y) Set custom gravity for the layer (overrides scene gravity) Number, Number
clearGravity() Revert to scene gravity -
getGravity() Get current gravity for the layer -
destroy() Destroy the layer and all it's objects -

Properties

Property Type Description
count Number Number of objects in the layer

Advanced Features

Project Management

  • New - Start a new project
  • Save - Save your project
  • Load - Load a saved project
  • Export - Download the code source as a text file
  • Publish - Publish the project
  • Settings - Configure the project settings

Asset System

Extend functionality by importing assets from the marketplace.

Accessing Assets

  1. Click the dropdown in the top bar
  2. Select Import to open the Asset Library
  3. Browse available assets and click to add them to your project
  4. Assets will automatically run when you execute your code

Managing Assets

Use the Manage option to view and remove currently loaded assets.

Asset Types

  • Scripts - Add new functions and behaviors
  • Sprites - Visual assets and graphics
  • Models - 3D objects
  • Audio - Sound effects and music
  • Bundles - Collections of related assets

Timers

Wait

Wait([seconds]).then(ƒ);

waitFor

waitFor([value, timeout]).then(ƒn);

waitUntil

waitUntil([value]).then(ƒn);

Loop

new Loop(ƒn, ...);
PropertyTypeDefaultDescription
intervalNumber-Time between executions
autoStartBooleantrueStart loop automatically on creation
maxIterationsNumber-Maximum number of iterations before auto-stop
MethodDescription
start()Starts the loop
stop()Stops the loop
Loop.stopAll()Stops all active loops

Iteration

new Iteration(() => [value], [targetValue], [{...}/steps]);
PropertyTypeDefaultDescription
variableAny-Variable to monitor
targetValueAny-Value to wait for
stepsNumber1Check interval in seconds
timeout.durationNumber-Max time to wait
timeout.callbackFunction-Function called on timeout

Countdown

Syntax

new UIElement("Countdown", config).at(time, callback);
PropertyTypeDefaultDescription
timeString"05:00"Starting time in MM:SS format
themeString"default"Visual theme for the display
colorString-Countdown color
glowBrightnessNumber0.6Brightness multiplier for the glow effect (0-1)
intervalNumber1Update interval in seconds
sizeNumber50Font size in pixels
positionObjectCenter of canvasScreen position
onEndFunction-Called when countdown reaches zero
MethodDescription
at(time, callback)Execute callback at specific MM:SS. Chainable.
pause()Pause the countdown
resume()Resume the countdown
restart()Restart from initial time
.themeGet/Set the theme
destroy()Remove the countdown

Stopwatch

Syntax

new UIElement("Stopwatch", config).at(time, callback);
PropertyTypeDefaultDescription
themeString"default"Visual theme for the display
colorString-Stopwatch color
glowBrightnessNumber0.6Brightness multiplier for the glow effect (0-1)
sizeNumber50Font size in pixels
intervalNumber1Update interval in seconds
positionObjectCenter of canvasScreen position
MethodDescription
at(time, callback)Execute callback at specific MM:SS. Chainable.
pause()Pause the stopwatch
resume()Resume the stopwatch
restart()Reset to zero and continue
stop()Stop the stopwatch
.themeGet/Set the theme
destroy()Remove the stopwatch

Themes

29 visual themes available for Countdown and Stopwatch: default, neon, flaming, lux, retro, glowing, tacticle, news, candy, floating, 80s, distant, outline, love, inset, blocks, grave, solid, cartoon, vegas, comic, deep, mummy, hero, dracula, blurry, emboss, press, carve, ghost.

Themes with glow support: neon, flaming, glowing, vegas, hero, love, outline.

Animation

Interpolates GameObject properties over time. Supports chaining and looping for complex motion.

new Animation([game object], [config]);
PropertyTypeDefaultDescription
typeString"position"Property to animate: position, rotation, scale, color
fromObject/Number/Stringcurrent valueStarting value
toObject/Number/String-Ending value
durationNumber1Animation duration
easingString"linear"Easing function: linear, easeIn, easeOut, easeInOut, bounce
loop Boolean/String false Loop behavior: true = loop this animation, "chain" = loop entire animation chain
pingPongBooleanfalseReverse direction on loop
carryObjectsBooleanfalseObjects touching this object move with it
onStartFunction-Called when animation starts
onCompleteFunction-Called when animation completes

Methods

MethodDescription
play()Starts the animation
pause()Pauses the animation
stop()Stops and resets to start value
seek(progress)Jump to a point in the animation (0-1)
reverse()Reverses animation direction
then(config)Chains another animation to run after this one
loopChain()Loops the entire animation chain sequence
destroy()Removes the animation

Particle System

Create particle effects. The ParticleSystem must be imported before use.

Syntax

new ParticleSystem(config);

Properties

PropertyTypeDefaultDescription
position Object {x: 0, y: 0} Emitter position in the scene
target GameObject - Attach emitter to a GameObject (follows its position)
points Array - Array of spawn positions. Two or more points form a connected path.
radius Number - Spread radius around each spawn point
color String - Particle color (overrides startColor)
shape String "circle" Particle render shape: "circle", "square", "triangle", "line"
stroke Boolean false Draw particles as outlines instead of filled
texture String - Image texture for particles
emissionRate Number 10 Particles emitted per second
burst Number - Number of particles to emit when the particles start playing
maxParticles Number 100 Maximum active particles
duration Number How long the system emits
autoDestroy Boolean false Instantly destroy when duration ends
autoPlay Boolean false Automatically start playing when created
blendMode String "normal" Blend mode: "normal", "additive", "multiply"
lifetime Object {min: 1, max: 3} How long each particle lives (seconds)
startSize Object {min: 2, max: 8} Starting size of particles
endSize Object {min: 0, max: 4} Ending size of particles
startColor String "#ffffff" Starting color
endColor String "#ffffff" Ending color (fades to this)
startAlpha Number 1 Starting transparency (0-1)
endAlpha Number 0 Ending transparency (0-1)
velocity Object {min: 10, max: 50} Particle speed range
angularVelocity Object {min: 0, max: 0} Rotation speed range
angle Object {min: 0, max: 6.28} Emission angle range (radians)
gravity Object {x: 0, y: 0} Gravity applied to particles
rotation Object {min: 0, max: 0} Starting rotation range

Methods

MethodDescriptionParameters
play() Start emitting particles -
pause() Pause particle emission -
emitBurst(count, duration) Emit a burst of particles Number, Number
destroy() Remove the particle system -

Utilities

Random

MethodDescriptionParametersReturns
random.int.range(min, max) Random integer between min and max (inclusive) Number, Number Number
random.float.range(min, max) Random float between min and max Number, Number Number
random.color(type) Random color in specified format "RGB", "HEX", "NAME" String

Math

FunctionDescriptionParametersReturns
clamp(value, min, max) Clamp value between min and max Number, Number, Number Number
lerp(start, end, factor) Linear interpolation between start and end Number, Number, Number Number
angleBetween(pointA, pointB) Angle in radians from pointA to pointB {x, y}, {x, y} Number

Context Menu

Create context menus.

Syntax

new ContextMenu(config);

Config

FormatTypeDescription
label Function Callback
label [icon:name] Function Icon
label Object Submenu
"---" - Visual separator

Methods

MethodDescriptionParameters
add(label, value) Add a new item to the menu String, Function/Object
remove(label) Remove an item from the menu String
enable(label) Enable a disabled item String
disable(label) Disable an item String
attachTo(gameObject) Attach menu to a GameObject GameObject
destroy(...labels) Remove specific items or the entire menu String(s)

Developer Console

The developer console is a real-time debugging and command interface for monitoring and interacting with your project at runtime.

It provides logging, command execution, error tracking, debug visualization, asset management, module importing, runtime inspection, and output control.

Logging Output

Use the console to display runtime information, warnings, and errors.

console.log("This is an informative log");
console.warn("This is a warning log");
console.error("This is an error log");
console.success("This is a success log");
  • console.log() - General information output
  • console.warn() - Non-critical warnings
  • console.error() - Critical errors
  • console.success() - Success messages

Command System

Commands are entered into the console and executed immediately. They allow direct interaction with engine systems at runtime.

Comments

The console supports inline comments using the # symbol. Everything after # is ignored during execution.

Error System

Filters

The SHOW ERRORS command supports filtering using the FILTER[...] syntax. This allows you to narrow results by source or message content.

Types

  • SRC - Filter by error source
  • CON - Filter by message content

Commands

  • SHOW ERRORS - Show the 10 most recent errors
  • SHOW ERRORS [number] - Show a specific number of errors (max: 50)
  • SHOW ERRORS * - Show all stored errors
  • SHOW ERRORS FILTER[SRC] {source, ...} - Filter errors by source
  • SHOW ERRORS FILTER[CON] {text, ...} - Filter errors by content
  • CLEAR ERRORS - Clear all stored errors
  • COUNT ERRORS - Show the total number of errors
  • HELP DEBUG - Show debug system help

Available Sources

  • asset-system (asset)
  • user-code (user)
  • auth-system (auth)
  • nav-system (nav)
  • help-system (help)
  • script-execution (script)
  • audio-system (audio)
  • sprite-system (sprite)
  • constraint-system (constraint)
  • security-violation (security)
  • async-command (async)
  • command-parsing (command)

Common Commands

byr@ByrLab:~$   INFO # Show project information
byr@ByrLab:~$   HELP # Show all available commands
byr@ByrLab:~$   HELP [command] # Show detailed help for a command
byr@ByrLab:~$   CLS # Clear console output
byr@ByrLab:~$   CLEARHISTORY # Clear command history
byr@ByrLab:~$   RUN # Execute current code
byr@ByrLab:~$   ECHO [text] # Print text to console
byr@ByrLab:~$   FPS # Display current FPS
byr@ByrLab:~$   VERSION # Show engine version
byr@ByrLab:~$   OPEN [destination] # Navigate to a section

Supported Destinations

  • home - Navigate to the homepage
  • profile - Open your user profile
  • market - Open the marketplace
  • community - Open the community section

Debug Commands

byr@ByrLab:~$   DEBUG STATUS # Show active debug systems
byr@ByrLab:~$   ENABLE DEBUG [type(s)] # Enable specific debug types
byr@ByrLab:~$   DISABLE DEBUG [type(s)] # Disable specific debug types
byr@ByrLab:~$   PERFORMANCE # Manage performance monitor

Supported Debug Types

  • angleindicator - Show angle indicators
  • axes - Show axes
  • bounds - Show bounding boxes
  • collisions - Visualize collision points
  • convexhulls/hulls - Show convex hulls
  • ids - Show object IDs
  • internaledges/edges - Show internal edges
  • positions - Show position markers
  • separations - Show separation vectors
  • shadows - Render debug shadows
  • sleeping - Indicate sleeping bodies
  • stats - Show performance stats
  • velocity - Show velocity vectors
  • vertexnumbers/vertices - Show vertex indices
  • wireframe - Toggle wireframe rendering

Available Performance Sub-Commands

  • ON - Enable the performance monitor
  • OFF - Disable the performance monitor
  • POSITION - Set performance monitor position (TOP / BOTTOM)
  • COLOR - Toggle between heatmap and one color mode
  • PROTECT - Toggle crash protection on/off
  • THRESHOLD - Set minimum FPS before protection triggers
  • TIMING - Set seconds before the scene is cleared

Import Commands

byr@ByrLab:~$   IMPORT [module] # Import module
byr@ByrLab:~$   IMPORT [module] AS [alias] # Import with alias
byr@ByrLab:~$   IMPORT [module] /g # Global import
byr@ByrLab:~$   IMPORT [module] /r # Replace existing import
byr@ByrLab:~$   IMPORT [module] /d # Import dependencies
byr@ByrLab:~$   UNIMPORT [module] # Remove module
byr@ByrLab:~$   UNIMPORT [module] /g # Remove global module
byr@ByrLab:~$   IMPORTS # List all imported modules

Available Modules

  • Keyboard - handles keyboard input, including key press, hold, release, and key combinations, providing a flexible event system for user controls
  • RelativeMovement - enables continuous movement relative to a target with configurable keybindings
  • ParticleSystem - creates and manages particle effects with configurable shapes, colors, velocities, blend modes, and burst emission

Asset Commands

byr@ByrLab:~$   ASSETS # List all loaded assets
byr@ByrLab:~$   BYR INSTALL [asset ID/name] # Install asset from marketplace
byr@ByrLab:~$   BYR UNINSTALL [asset ID/name] # Uninstall asset from marketplace

Runtime Inspection

byr@ByrLab:~$   LIST GAME OBJECTS # List all scene objects
byr@ByrLab:~$   GET # Log object to console
byr@ByrLab:~$   SELECT # Highlight object in scene

Add a properties bracket to open an interactive panel: SELECT name -> [name] [*] for all properties, or SELECT name -> [name] [properties] for specific ones.

Output Mode

byr@ByrLab:~$   INLINE ON # Enable inline output
byr@ByrLab:~$   INLINE OFF # Disable inline output

Spam Protection

byr@ByrLab:~$   SPAM PROTECTION # Show current status
byr@ByrLab:~$   SPAM PROTECTION ON # Enable spam protection
byr@ByrLab:~$   SPAM PROTECTION OFF # Disable spam protection
byr@ByrLab:~$   SPAM PROTECTION LIMIT [count] WITHIN [time] # Set custom rate limit

Note

  • Commands are case-insensitive
  • Multiple arguments and flags are supported

Debug System

The Debug system provides visual development aids, including grids and wireframe toggles.

Grid

Toggle a reference grid overlay for spatial orientation.

showGrid();
hideGrid();

Grid Properties

PropertyTypeDefaultDescription
sizeNumber29.9Grid cell size in pixels
typeString"lines"Grid style: "dots", "lines", "squares"
colorString"#ffffff"Grid color
opacityNumber0.1Grid opacity (0-1)
axisBooleantrueShow X/Y axis lines at center

Helper

The Helper class provides visual debugging tools for GameObjects, Hitboxes, and Constraints. It can display bounding boxes, position markers, labels, and audio icons.

Syntax

new Helper(target, options);

Helper Methods

Method Description Parameters
show() Show the helper visualization -
hide() Hide the helper visualization -
toggle() Toggle helper visibility on/off -
destroy() Remove the helper and clean up resources -

Options

Option Type Default Description
color String Auto-detected Helper color (default: green for GameObjects, yellow for Constraints, red for Hitboxes)
lineWidth Number 2 Width of the outline stroke
opacity Number 0.8 Opacity of the helper (0-1)
label Boolean/Object false Show object name label. Pass object for custom positioning
pulsate Boolean false Enable pulsing animation effect

Label Options

When label is an object, you can configure:

Property Type Default Description
enabled Boolean true Enable/disable label
size Number 12 Font size in pixels
position String "top" Label position: top, bottom, left, right, center
color String Same as helper color Label text color
offset Number 5 Offset from the object in pixels
Pixel