BrightScript 2D API Emulator :: v0.8 Beta

About the Project

As a BrightScript developer since 2012, I always wanted a way to test my code without the need of a Roku device, in situations like a long flight or a place without any wireless network available. Back in 2016 I decided to learn about the ifDraw2D API in order to develop games for the platform, so I created a few open source remakes of classic games (see links below on Games and Demos). These projects were very challenging and exciting to develop, but brought me some frustration with it, as very few people outside the USA has access to the Roku platform, so a lot of my friends could only see videos of my games, but never play those.

The solution would be to develop an emulator for the platform, but that was, to me, a very complex endeavor to start as a side project, so I shelved the idea in my Brain Dump Trello board, until recently, when I learned about the BRS open source project, a command line interpreter for BrightScript created by Sean Barag.

I could immediatly see, that this project was the missing piece to turn my emulator project a reality! I forked BRS and started collaborating, sending pull requests to the project, so the interpreter could have the minimum set of components that would make possible for me to work upon it. In the same weekend I could develop a working proof-of-concept using HTML5 Canvas and after a month of nights and weekends studying TypeScript/Javascript, and exploring all sort of options to overcome different challenges, I finally came up with this prototype that is available here.

Games and Demos

Prince of Persia port for Roku by Marcelo Lv Cabral .

. Lode Runner remake for Roku by Marcelo Lv Cabral .

. Retaliate game created by Romans-I-XVI .

. Pong example game for the Roku Game Engine by Romans-I-XVI.

You can try the emulator by loading one of the games or demonstration channels, using the clickable icons above or loading your own code, either as a singlefile or a channel. Some of the games are available as open source projects at the repositories linked below:

You can also find above, a couple of commercial channels I created for Roku that are available at the Channel Store.

Quartet port for Roku by Marcelo Lv Cabral . Get it at the Roku Channel Store.

. Get it at the Roku Channel Store. Poker Clock channel by Marcelo Lv Cabral. Get it at the Roku Channel Store.

Technology and Compatibility

This emulator is bundled as a Webpack Javascript library that runs as a Web Worker in the browser, and it uses features like SharedArrayBuffer and OffScreenCanvas, that are bleeding edge in the browser engines implementation, because of that, at this moment, it can only be executed in Chromium based browsers, like Chrome, Brave, Opera and the new Microsoft Edge. The BrightScript 2D API Emulator is a full client-side application, nothing is sent or processed in the server side.

Desktop Application

In addition to this web application, I also developed a multi-platform desktop application (Windows, macOS & Linux) that uses the same library generated by this project, and has a lot of additional functionalities, including full screen mode and integration with VS Code Extension for debugging. The desktop app can be dowloaded from the project Release Page, the source code is also available at https://github.com/lvcabral/brs-emu-app.

Current Limitations

Note for BrightScript Developers

print

Documentation and Downloads

As mentioned above, this emulator is a, this way, there are several features from thelanguage and components that are still not supported, some are planned to be implemented, others will stay as mock objects (for compatibility), and some are considered out of scope of this project. Please check the project documentation to get an updated list of all current limitations You can see the debug messages fromstatements in your code using the browser console, just right click anywhere in the page and select Inspect (Ctrl+Shift+i). Exceptions from the emulator will be shown there too. Download the desktop app to use it integrated with, you will find more details in the links below.

To learn more about the project visit the repository at: https://github.com/lvcabral/brs-emu/

To download the Desktop Applications for Windows, macOS and Linux go to the releases page.

You can download the source code of this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://github.com/lvcabral/brs-emu.git