Castle Game Engine integration with QuickJS (JavaScript)

Posted on

cge_js

Coldzer0 is working on an integration of Castle Game Engine and QuickJS, a powerful JavaScript engine.

  1. Check out this demo how to use JavaScript as a scripting language in your game. It shows how to execute a JavaScript from a Pascal program, and also provide some functions to be called from JavaScript (and handle them in Pascal). So we have a bi-directional integration with JavaScript.

    The QuickJS demo by Coldzer0 is based on SnakeGame by Eugene Loza. In the original game, you control a snake using the keyboard. In the QuickJS demo, you control the snake by implementing an A.I. using JavaScript, like this: data/movement.js. See the demo README for details.

  2. As a next step, Coldzer0 is working on exposing Castle Game Engine API in JavaScript. The idea is to allow to code a complete game using JavaScript, if you prefer/know this language better than our Pascal 🙂

    Similar to how other engines expose integrations with various programming languages, we’re open to exposing our APIs in other programming languages than Pascal. To remind, you can already use a subset of CGE from the C and C++ languages. Michalis is happy that more integrations will appear 🙂 The more people can use our engine -> the better for the engine future.

    Here’s a movie showing instantiation and usage of TCastleTimer from JavaScript:

Start the discussion at Castle Game Engine Forum