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
GameObject = Circle;
Rectangle / Rect
GameObject = Rectangle;
Square
GameObject = Square;
Triangle
GameObject = Triangle;
Capsule
GameObject = Capsule;
Sprite
Create animated sprites using the GameObject function.
Syntax
GameObject = Sprite;
Sprite Object Methods
| Method | Description | Parameters |
|---|---|---|
| PLAY ANIMATION [name] | Play animation | name: String, options: Object |
| PAUSE | Pause animation | - |
| RESUME | Resume animation | - |
| STOP | Stop animation | - |
| SET FRAME [frame] | Set specific frame | frame: Number |
| SET FPS [fps] | Set animation speed | fps: Number |
| GET CURRENT ANIMATION | Get current animation | → String |
| GET CURRENT FRAME | Get current frame | → Number |
| IS PLAYING | Check if playing | → Boolean |
Text
Create text elements using the GameObject function.
Syntax
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 |
| BACKGROUND COLOR | String | "transparent" | Background color |
| DYNAMIC | Boolean | true | Whether text can move |
Text Object Methods
| Method | Description | Parameters |
|---|---|---|
| UPDATE TEXT [newText] | Update text content | newText: String |
| SET COLOR [color] | Change text color | color: String |
| SET BACKGROUND COLOR [color] | Change background color | color: String |
| SET FONT SIZE [size] | Change font size | size: 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
GameObject = Audio;
Audio Object Methods
| Method | Description | Parameters |
|---|---|---|
| PLAY | Play audio | - |
| PAUSE | Pause audio | - |
| STOP | Stop audio | - |
| SET VOLUME [volume] | Set volume (0-1) | volume: Number |
| SET LOOP [loop] | Set looping | loop: Boolean |
| SEEK [time] | Seek to time | time: Number |
| SET AUDIO SOURCE [src] | Change audio source | src: String |
| GET DURATION | Get audio duration | - |
| GET CURRENT TIME | Get current time | - |
| IS PLAYING | Check if playing | - |
| IS PAUSED | Check if paused | - |
| HAS ENDED | Check if ended | - |
| ATTACH TO [gameObject] | Attach audio to a GameObject | gameObject: GameObject |
| FADE VOLUME [targetVolume] [duration] | Smoothly fade volume over time | targetVolume: Number, duration: Number |
| CROSSFADE TO [otherAudio] [duration] | Crossfade to another audio | otherAudio: GameObject, duration: Number |
| GET FREQUENCY | Get frequency spectrum data | - |
| GET WAVEFORM | Get waveform amplitude (0-100) | - |
Video
Create video objects using the GameObject function.
Syntax
GameObject = Video;
Video Object Methods
| Method | Description | Parameters |
|---|---|---|
| PLAY | Play video | - |
| PAUSE | Pause video | - |
| STOP | Stop video and reset to beginning | - |
| SET VOLUME [volume] | Set volume (0-1) | volume: Number |
| SET LOOP [loop] | Set looping | loop: Boolean |
| SET VIDEO SOURCE [src] | Change video source | src: String |
WebView
Create a webview object that displays embedded web content.
Syntax
GameObject = WebView;
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| 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
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
| Property | Type | Default | Description |
|---|---|---|---|
| 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
| Method | Description | Parameters |
|---|---|---|
| SET LENGTH [newLength] | Set new distance length (distance constraints only) | Number |
| SET STIFFNESS [newStiffness] | Set spring stiffness | Number |
| SET DAMPING [newDamping] | Set spring damping | Number |
| BREAK | Break the constraint | - |
Game Object Properties
| Property | Type | Default | Description |
|---|---|---|---|
| POSITION | Object | {x: 0, y: 0} | Object position in the scene |
| ROTATION | Number | 0 | Rotation in radians |
| VELOCITY | Object | {x: 0, y: 0} | Current linear velocity |
| ANGULAR VELOCITY | Number | 0 | Current angular velocity |
| COLOR | String | "white" | Fill color |
| DYNAMIC | Boolean | false | Whether object can move |
| FRICTION | Number | 0.1 | Surface friction level (0-1) |
| RESTITUTION | Number | 0.8 | Bounciness of object (0-1) |
| SCALE | Object | {x: 100, y: 100} | Object size (width and height) |
| WIDTH | Number | - | Width of the object |
| HEIGHT | Number | - | Height of the object |
| RADIUS | Number | - | Radius |
| NAME | String | - | Unique identifier |
Game Object Methods
These methods allow you to control and manipulate 2D objects.
| Method | Description | Parameters |
|---|---|---|
| APPLY FORCE [x] [y] | Apply force to object | x, y |
| SET VELOCITY [x] [y] | Set linear velocity | x, y |
| SET ANGULAR VELOCITY [value] | Set angular velocity | Number |
| SET POSITION [x] [y] | Set object position | x, y |
| SET ROTATION [angle] | Set rotation angle | Number (radians) |
| SET SCALE [scaleX] [scaleY] | Scale object | Number, Number |
| DESTROY | Remove object from scene | - |
| SET COLOR [color] | Change object color | String |
| DISTANCE TO [target] | Calculate distance to another object | GameObject → Number |
| DIRECTION TO [target] | Get normalized direction to another object | GameObject → {x, y} |
| LOOK AT [target] | Rotate to face another object | GameObject |
| WRAP EDGES [scene] [padding] | Wrap around scene edges | Scene, Number |
| UNWRAP EDGES | Disable edge wrapping | - |
| SET WIREFRAME [enabled] | Toggle wireframe rendering | Boolean |
| SET GRAVITY [x] [y] | Set custom gravity for this object | Number, Number |
| CLEAR GRAVITY | Reset object to scene gravity | - |
| SPIN : SPEED [speed] REVERSE [reverse] | Make object spin continuously | speed, reverse |
| STOP SPIN | Stop the spinning | - |
| SET RELATIVE MOVEMENT [enabled] [bindings] | Enable movement for object | Boolean, 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:
- 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
ON [GameObject] [event]
...
END
[GameObject] TRIGGER [event];
[GameObject] TRIGGER [event] [eventData];
Event Methods
| Method | Description | Parameters |
|---|---|---|
| ON [event] ... END |
Listen for an event | String, Function |
| TRIGGER [event] | Trigger an event | String |
| TRIGGER [event] [eventData] | Trigger an event with data | 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 |
|---|---|---|
| ON KEY PRESS [keys] ... END |
Trigger callback when key(s) are pressed | String/Array, Function |
| ON KEY HOLD [keys] [duration] ... END |
Trigger callback after holding key(s) for duration | String/Array, Function, Number |
| ON KEY RELEASE [keys] ... END |
Trigger callback when key(s) are released | String/Array, Function |
| ON KEY COMBO [combo] ... END |
Trigger callback when all keys in combo are pressed | Array, Function |
| ON KEY COMBO HOLD [combo] [duration] ... END |
Trigger callback after holding combo for duration | Array, Function, Number |
| ON KEY COMBO RELEASE [combo] ... END |
Trigger callback when any key in combo is released | Array, Function |
| KEYBOARD ENABLE CONTEXT [element] | Restrict keyboard events to specific UI element | UI Element |
| KEYBOARD DISABLE CONTEXT | Remove context restriction | - |
| KEYBOARD CLEAR ALL | Clear all handlers, timers, and key states | - |
UI System
The UI System allows you to create interactive user interface elements.
Available Elements
Button- Clickable buttonLabel- Text displayPanel- Container for other UI elementsSlider- Draggable range selectorProgressBar- Visual progress indicatorInput/Textbox- Text input fieldWebView- Embedded web contentCountdown- Countdown timerStopwatch- Stopwatch timer
Syntax
UI [type] : [properties];
Adding to Scene
COM Scene-specific UI (clears when scene changes)
button ADD TO SCENE;
Adding Globally
COM Persistent UI (stays across all scenes)
button ADD;
UIElement Methods
| Method | Description | Parameters |
|---|---|---|
| ADD TO SCENE | Add UI to a specific scene (scene-specific) | Scene |
| ADD | Add UI as global (persists across scenes) | - |
| SET POSITION [x] [y] | Set UI position | Number, Number |
| SET SIZE [width] [height] | Set UI size | Number, Number |
| SET TEXT [text] | Set text content | String |
| SET VALUE [value] | Set slider or progress value | Number |
| SET COLOR [color] | Set text color | String |
| SET BACKGROUND COLOR [color] | Set background color | String |
| SET FONT SIZE [size] | Set font size in pixels | Number |
| SET STYLE : [style] | Apply CSS styles | Object |
| SET CURSOR [cursorType] | Set mouse cursor style | String |
| ON [event] ... END |
Add event listener | String, Function |
| OFF [event] | Remove event listener | String |
| 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
UI WebView : [properties];
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| CHANNEL | String | - | Channel name (Twitch) or video ID (YouTube) |
| VIDEOID | String | - | Alternative to channel for YouTube video IDs |
Countdown
Syntax
UI Countdown : [config] AT [time]
[callback]
END
| Property | Type | Default | Description |
|---|---|---|---|
| TIME | String | "05:00" | Starting time in MM:SS format |
| THEME | String | "default" | Visual theme for the display |
| COLOR | String | - | Countdown color |
| GLOWBRIGHTNESS | Number | 0.6 | Brightness multiplier for the glow effect (0-1) |
| INTERVAL | Number | 1 | Update interval in seconds |
| SIZE | Number | 50 | Font size in pixels |
| POSITION | Object | Center of canvas | Screen position |
| end | Function | - | Called when countdown reaches zero |
| Method | Description |
|---|---|
| AT [time] ... END | Execute callback at specific MM:SS. Chainable. |
| PAUSE | Pause the countdown |
| RESUME | Resume the countdown |
| RESTART | Restart from initial time |
| THEME [theme] | Get/Set the theme |
| DESTROY | Remove the countdown |
Stopwatch
Syntax
UI Stopwatch : [config] AT [time]
[callback]
END
| Property | Type | Default | Description |
|---|---|---|---|
| THEME | String | "default" | Visual theme for the display |
| COLOR | String | - | Stopwatch color |
| GLOWBRIGHTNESS | Number | 0.6 | Brightness multiplier for the glow effect (0-1) |
| SIZE | Number | 50 | Font size in pixels |
| INTERVAL | Number | 1 | Update interval in seconds |
| POSITION | Object | Center of canvas | Screen position |
| Method | Description |
|---|---|
| AT [time] ... END | 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 |
| THEME [theme] | Get/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
COLLISION OF [objects];
You can pass a single object or an array of objects to monitor collisions between them.
Collision Methods
| Method | Description | Parameters |
|---|---|---|
| ON [collision] COLLISION START ... END |
Called when two objects start colliding | Function(objA, objB) |
| ON [collision] COLLISION END ... END |
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:
ON [GameObject] COLLISION START WITH [other]
...
END
ON [GameObject] COLLISION END WITH [other]
...
END
Hitbox
Hitboxes are invisible collision shapes that can be attached to GameObjects for precise collision detection.
Syntax
Hitbox [shapeType] : [properties];
Shape Types
rectangle/rect- Rectangular hitboxcircle- Circular hitboxcapsule- Capsule hitbox
Hitbox Methods
| Method | Description | Parameters |
|---|---|---|
| ATTACH TO [gameObject] : OFFSET [x] [y] | Attach hitbox to a GameObject | GameObject, {offset} |
| ON [event] ... END |
Add event listener | String, Function |
| OFF [event] | Remove event listener | String |
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 scene dimensions | Object {x, y} |
| ADD TO SCENE [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
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
| Property | Type | Default | Description |
|---|---|---|---|
| POSITION | Object | { x: 0, y: 0 } | Camera's current position in the world |
| ZOOM | Number | 1 | Current zoom level |
| BORDER VISIBLE | Boolean | 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 | 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
| Method | Description |
|---|---|
| ACTIVATE | Activate this camera |
| DEACTIVATE | Deactivate this camera |
| ATTACH TO [target] [smoothness] | Attach camera to follow a target |
| PAN TO [x] [y] [duration] [smooth] | Pan camera to position |
| ZOOM TO [targetZoom] [duration] | Smoothly zoom to level |
| SHAKE [intensity] [duration] | Camera shake effect |
| FADE [color] [duration] [type] | Fade in/out/in-out effect |
| SET VIEWPORT [x] [y] [width] [height] [normalized] | Set camera viewport region |
| SET BORDER : VISIBLE [visible] COLOR [color] WIDTH [width] | Set border options |
| SET LABEL : VISIBLE [visible] TEXT [text] COLOR [color] FONT [font] | Set label options |
| DESTROY | Remove the camera |
Layers
Layers allow you to organize game objects into groups for collective control.
Syntax
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 |
| COMMAND ALL [callback] | Execute a function on all objects in the layer | Function |
| CLEAR | Remove all objects from the layer | - |
| SET GRAVITY [x] [y] | Set custom gravity for the layer | Number, Number |
| CLEAR GRAVITY | Revert to scene gravity | - |
| GET GRAVITY | Get current gravity for the layer | - |
| DESTROY | Destroy the layer and all its 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
- Click the dropdown in the top bar
- Select Import to open the Asset Library
- Browse available assets and click to add them to your project
- 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]
...
END
waitFor
WAIT FOR [value]
...
END
waitUntil
WAIT UNTIL [value] [targetValue]
...
END
Loop
LOOP
...
END
LOOP EVERY [seconds]
...
END
| Property | Type | Default | Description |
|---|---|---|---|
| INTERVAL | Number | - | Time between executions |
| REPEAT [number] TIMES | Number | - | Maximum number of iterations before auto-stop |
| Method | Description |
|---|---|
| START | Starts the loop |
| STOP | Stops the loop |
| LOOP STOP ALL | Stops all active loops |
Iteration
ITERATION [value] [targetValue] : STEPS [n]
...
END
ITERATION [value] [targetValue] : STEPS [n] TIMEOUT [seconds]
...
TIMEOUT_CALLBACK
...
END
| Property | Type | Default | Description |
|---|---|---|---|
| variable | Any | - | Variable to monitor |
| targetValue | Any | - | Value to wait for |
| STEPS | Number | 1 | Check interval in seconds |
| TIMEOUT | Number | - | Max time to wait |
| TIMEOUT CALLBACK | Function | - | Function called on timeout |
Countdown
Syntax
UI Countdown : [config] AT [time]
[callback]
END
| Property | Type | Default | Description |
|---|---|---|---|
| TIME | String | "05:00" | Starting time in MM:SS format |
| THEME | String | "default" | Visual theme for the display |
| COLOR | String | - | Countdown color |
| GLOWBRIGHTNESS | Number | 0.6 | Brightness multiplier for the glow effect (0-1) |
| INTERVAL | Number | 1 | Update interval in seconds |
| SIZE | Number | 50 | Font size in pixels |
| POSITION | Object | Center of canvas | Screen position |
| end | Function | - | Called when countdown reaches zero |
| Method | Description |
|---|---|
| AT [time] ... END | Execute callback at specific MM:SS. Chainable. |
| PAUSE | Pause the countdown |
| RESUME | Resume the countdown |
| RESTART | Restart from initial time |
| THEME | Get/Set the theme |
| DESTROY | Remove the countdown |
Stopwatch
Syntax
UI Stopwatch : [config] AT [time]
[callback]
END
| Property | Type | Default | Description |
|---|---|---|---|
| THEME | String | "default" | Visual theme for the display |
| COLOR | String | - | Stopwatch color |
| GLOWBRIGHTNESS | Number | 0.6 | Brightness multiplier for the glow effect (0-1) |
| SIZE | Number | 50 | Font size in pixels |
| INTERVAL | Number | 1 | Update interval in seconds |
| POSITION | Object | Center of canvas | Screen position |
| Method | Description |
|---|---|
| AT [time] ... END | 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 |
| THEME | Get/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.
Animation [gameObject] : [config];
| Property | Type | Default | Description |
|---|---|---|---|
| TYPE | String | "position" | Property to animate: position, rotation, scale, color |
| FROM | Object/Number/String | current value | Starting value |
| TO | Object/Number/String | - | Ending value |
| DURATION | Number | 1 | Animation duration |
| EASING | String | "linear" | Easing function: linear, easeIn, easeOut, easeInOut, bounce |
| LOOP | Boolean/String | false | Loop behavior: true = loop this animation, "chain" = loop entire animation chain |
| PINGPONG | Boolean | false | Reverse direction on loop |
| CARRYOBJECTS | Boolean | false | Objects touching this object move with it |
| ONSTART | Function | - | Called when animation starts |
| ONCOMPLETE | Function | - | Called when animation completes |
Methods
| Method | Description |
|---|---|
| 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 |
| LOOP CHAIN | Loops the entire animation chain sequence |
| DESTROY | Removes the animation |
Particle System
Create particle effects. The ParticleSystem must be imported before use.
Syntax
ParticleSystem : [config];
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| 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 |
| ANGULAR VELOCITY | 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
| Method | Description | Parameters |
|---|---|---|
| PLAY | Start emitting particles | - |
| PAUSE | Pause particle emission | - |
| EMIT BURST [count] [duration] | Emit a burst of particles | Number, Number |
| DESTROY | Remove the particle system | - |
Utilities
Random
| Method | Description | Parameters | Returns |
|---|---|---|---|
| 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
| Function | Description | Parameters | Returns |
|---|---|---|---|
| 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 |
| ANGLE BETWEEN [pointA] [pointB] | Angle in radians from pointA to pointB | {x, y}, {x, y} | Number |
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 [message];
CONSOLE WARN [message];
CONSOLE ERROR [message];
CONSOLE SUCCESS [message];
- 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 sourceCON- Filter by message content
Commands
SHOW ERRORS- Show the 10 most recent errorsSHOW ERRORS [number]- Show a specific number of errors (max: 50)SHOW ERRORS *- Show all stored errorsSHOW ERRORS FILTER[SRC] {source, ...}- Filter errors by sourceSHOW ERRORS FILTER[CON] {text, ...}- Filter errors by contentCLEAR ERRORS- Clear all stored errorsCOUNT ERRORS- Show the total number of errorsHELP 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 homepageprofile- Open your user profilemarket- Open the marketplacecommunity- 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 indicatorsaxes- Show axesbounds- Show bounding boxescollisions- Visualize collision pointsconvexhulls/hulls- Show convex hullsids- Show object IDsinternaledges/edges- Show internal edgespositions- Show position markersseparations- Show separation vectorsshadows- Render debug shadowssleeping- Indicate sleeping bodiesstats- Show performance statsvelocity- Show velocity vectorsvertexnumbers/vertices- Show vertex indiceswireframe- Toggle wireframe rendering
Available Performance Sub-Commands
ON- Enable the performance monitorOFF- Disable the performance monitorPOSITION- Set performance monitor position (TOP/BOTTOM)COLOR- Toggle between heatmap and one color modePROTECT- Toggle crash protection on/offTHRESHOLD- Set minimum FPS before protection triggersTIMING- 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 controlsRelativeMovement- enables continuous movement relative to a target with configurable keybindingsParticleSystem- 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.
SHOW GRID;
HIDE GRID;
Grid Properties
| Property | Type | Default | Description |
|---|---|---|---|
| SIZE | Number | 29.9 | Grid cell size in pixels |
| TYPE | String | "lines" | Grid style: "dots", "lines", "squares" |
| COLOR | String | "#ffffff" | Grid color |
| OPACITY | Number | 0.1 | Grid opacity (0-1) |
| AXIS | Boolean | true | Show 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
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 |
Errors
Below is a comprehensive list of common errors you may encounter in the BYR Lab console, along with their causes and solutions.
Syntax & Parsing Errors
Missing punctuation
Cause: Sometimes we just forget to include necessary punctuation like commas or semicolons. It happens to the best of us.
// Wrong (Check for missing punctuation or operators near 'health')
const player = {
name: "Warrior" // Missing comma
health: 100
};
// Correct
const player = {
name: "Warrior",
health: 100
};
Mismatched/Misplaced Token
Cause: A character (like `{`, `}`, `[`, `]`, `(`, `)`) appears in the wrong place.
// Wrong (Unexpected token ')')
const array = [1, 2, 3); // Mismatched brackets
// Correct
const array = [1, 2, 3];
Reference Errors
[Variable] is not defined
Cause: You tried to use a variable or function that hasn't been declared, or is out of scope.
// Wrong (variable is not defined)
console.log(variable);
// Correct
let variable = "value";
console.log(variable);
[Class] is not imported
Cause: You tried to use a module without importing it first.
byr@ByrLab:~$ IMPORT [module]
Run the IMPORT command in the console to fix this.
Type Errors
Cannot access '...' before initialization
Cause: You tried to use a const or let variable before it was declared in the code. JavaScript hoists declarations but not initializations, so accessing them before the line where they are defined throws this error.
// Wrong (Cannot access 'variable' before initialization)
console.log(variable);
const variable = "value";
// Correct
const variable = "value";
console.log(variable);
Asset not found
Cause: You referenced an asset that doesn't exist or hasn't been loaded into your project.
Fix: If the asset does exist, make sure to hover over the Assets dropdown in the top bar, click the Import button, and then select the desired asset(s) that you want to load into the project. To make sure that the asset(s) loaded into the project, hover over the Assets dropdown and use the Manage button. That will open a panel on the right side, displaying all the loaded assets.
Still Stuck
If you're seeing an error that's not listed in this section, please ask for help on the Need Help community section