Coldzer0 is working on an integration of Castle Game Engine and QuickJS, a powerful JavaScript engine.
-
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.
-
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: