Embedded JavaScript bindings for raylib, a simple and easy-to-use library to learn videogames programming.
raylib-duktape
uses Duktape and Dukglue.
const screenWidth = 800
const screenHeight = 450
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
SetTargetFPS(60)
while (!WindowShouldClose()) {
BeginDrawing()
ClearBackground(RAYWHITE)
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
EndDrawing()
}
CloseWindow()
A raylib-duktape CLI launcher is provided to allow running raylib JavaScript files.
raylib-duktape core_basic_window.js
Initialize raylib-duktape through your Duktape context.
#include "raylib-duktape.h"
// After initializing the Duktape heap...
duk_raylib_init(ctx, 0);
git clone https://github.com/RobLoach/raylib-duktape.git
cd raylib-duktape
mkdir build
cd build
cmake ..
make
make test