From f88332cec551d4feb55ba44e8aea1afe76ad737a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 16 Jul 2026 17:28:22 +0000 Subject: [PATCH] Update generated docs --- docs/index.html | 53 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 0696c885..e6cfaefe 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,6 +1,55 @@ Brighterscript Game Engine
On this page

BrighterScript Game Engine

An object oriented game engine for the Roku, written in BrighterScript, and (someday) available via ROPM.

This project is designed to be used with VScode.

This was originally forked from Roku-gameEngine by Austin Sojka, and converted into BrighterScript. This work owes a lot to this original project!

Introduction

The purpose of this project is to make it easy to develop games for the Roku in an object oriented fashion. Similar to how you would with an engine such as Phaser, HaxeFlixel, Gamemaker or Unity (minus any visual software that is).

Cloning and Running Examples

The BrighterScript Game Engine public repository is on Github

Clone the project:

git clone https://github.com/markwpearce/brighterscript-game-engine.git
+    
On this page

BrighterScript Game Engine

An object-oriented game engine and 2D/3D drawing library for Roku, written in BrighterScript.

Build a full game with entities, rooms, collisions, input, and UI - or just pull in the renderer to draw sprites, shapes, billboards, and wireframe/solid 3D models on top of your own Roku app. Same engine, use as much or as little of it as you need.

Asteroids example 3D example Snake example

Why BrighterScript Game Engine?

  • Object-oriented, like the engines you already know. GameEntity, Room, and lifecycle hooks (onCreate, onUpdate, onCollision, onDrawBegin/onDrawEnd, ...) give you the same shape as Phaser, HaxeFlixel, GameMaker, or Unity - minus the visual editor.
  • A real 2D/3D renderer, not just sprite blitting. Draw images, sprites, animations, shapes, text, and billboards, or render actual 3D models (loaded from .stl) with wireframe, solid, and shaded draw modes - all built on Roku's roCompositor/Draw2D, so it runs on real hardware.
  • Built-in collisions, input, UI, and debug tooling. Circle/rectangle colliders, a retained-mode UI widget tree, and debug overlays (FPS, colliders, memory, GC stats) come standard, so you're not rebuilding the basics for every project.
  • Use only what you need. The Renderer/Canvas layer works standalone if you just want a capable drawing library for an existing Roku app, without adopting the full game loop.
  • Develop without a physical Roku. This engine supports running under the BrightScript Simulator, Marcelo Lv Cabral's desktop BrightScript simulator, so you can iterate on your game without deploying to hardware every time.

A quick taste

sub main()
+  game = new BGE.Game(1280, 720)
+  game.fitCanvasToScreen()
+  game.loadBitmap("player", "pkg:/sprites/player.png")
+
+  room = new MainRoom(game)
+  game.defineRoom(room)
+  game.changeRoom(room.name)
+
+  game.play()
+end sub
+
class MainRoom extends BGE.Room
+
+  sub new(game as BGE.Game)
+    super(game)
+    m.name = "MainRoom"
+  end sub
+
+  override sub onCreate(args as roAssociativeArray)
+    m.game.addEntity(new Player(m.game))
+  end sub
+
+end class
+
class Player extends BGE.GameEntity
+
+  sub new(game as BGE.Game)
+    super(game)
+    m.name = "Player"
+  end sub
+
+  override sub onCreate(args as roAssociativeArray)
+    m.position = m.game.canvas.renderer.getCanvasCenter()
+    bitmap = m.game.getBitmap("player")
+    region = CreateObject("roRegion", bitmap, 0, 0, bitmap.GetWidth(), bitmap.GetHeight())
+    m.addImage("sprite", region)
+    m.addCircleCollider("body", bitmap.GetWidth() / 2)
+  end sub
+
+  override sub onInput(input as BGE.GameInput)
+    m.velocity.x = input.x * 10
+    m.velocity.y = input.y * 10
+  end sub
+
+  override sub onCollision(myCollider as BGE.Collider, otherCollider as BGE.Collider, otherEntity as BGE.GameEntity)
+    m.game.postGameEvent("player_hit", {by: otherEntity})
+  end sub
+
+end class
+

This exact code lives in examples/quickstart as a runnable app. See the Documentation for the full API, and the examples below for complete, runnable projects.

Examples

The examples/ directory has full Roku channels you can build and run:

ExampleWhat it shows
quickstartThe minimal MainRoom/Player example from above, as a runnable app
asteroidsA complete 2D game - player movement, bullets, collisions, particle-style explosions, sound
pongClassic 2D Pong, playable in both 2D and 3D camera modes
snakeGrid-based movement and growing collision shapes, in 2D and 3D
3dLoading and rendering .stl 3D models with the pseudo-3D renderer
pixelsA tour of drawables - polygons, rectangles, sprites, and more, one room per shape
canvasUsing the engine's canvas/renderer as a standalone drawing surface
hybridMixing this engine's Draw2D-based rendering with a SceneGraph app
rendererTestA manual test harness used while developing the renderer itself

Scaffold a new example (manifest, icons/splash, package.json, a minimal MainRoom) with:

npm run create-example -- <name> ["Display Title"]
+

Cloning and Running Examples

The BrighterScript Game Engine public repository is on Github

Clone the project:

git clone https://github.com/markwpearce/brighterscript-game-engine.git
 

This project includes various example Roku apps in the examples directory. To run them, you will need a Roku and have it set up properly for doing development. See: https://developer.roku.com/en-ca/docs/developer-program/getting-started/developer-setup.md.

To run the examples:

Install dependencies:

cd brighterscript-game-engine
 npm install
 

You will need to set up each project in the examples directories. You can do this by using this script:

npm run prepare-examples
@@ -10,4 +59,4 @@
 ROKU_HOST=<local IP address of the target roku>
 

Then simply run one of the Debug configurations from the Debug tab.

Installation

NOTE - Not available yet from ropm!

Use ropm:

ropm install brighterscript-game-engine
 

Suggestion - use a shorter prefix (we use bge in the documentation):

ropm install bge@npm:brighterscript-game-engine
-

Documentation

Documentation can be found here

\ No newline at end of file +

Documentation

Documentation can be found here

Acknowledgements

This project was originally forked from Roku-gameEngine by Austin Sojka, and converted into BrighterScript. This work owes a lot to this original project!

Thanks also to:

\ No newline at end of file