Node.js bindings for Raylib
https://github.com/RobLoach/node-raylib.git
Node.js bindings for raylib, a simple and easy-to-use library to enjoy videogames programming (www.raylib.com).
| Name | Description | Author |
|---|---|---|
| Offical Examples | Ports of raylib's examples to node-raylib | @RobLoach, @twunky, @konsumer |
| Flappy | A Flappy Bird clone | @arthurmassanes |
| Retro RPG Template | Small prototype to build a retro-inspired RPG game | @konsumer |
| Chip8 | A CHIP-8 emulator whose native client using node-raylib | @taniarascia |
bash
mkdir myexample
cd myexample
%%CODEBLOCK0%% json
{
"dependencies": {
"raylib": "*"
},
"scripts": {
"start": "node index.js"
}
}
%%CODEBLOCK1%% javascript
const r = require('raylib')
const screenWidth = 800
const screenHeight = 450
r.InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
r.SetTargetFPS(60)
while (!r.WindowShouldClose()) {
r.BeginDrawing();
r.ClearBackground(r.RAYWHITE)
r.DrawText("Congrats! You created your first node-raylib window!", 120, 200, 20, r.LIGHTGRAY)
r.EndDrawing()
}
r.CloseWindow()
%%CODEBLOCK2%% bash
npm install
%%CODEBLOCK3%% bash
npm start
%%CODEBLOCK4%%
npm install raylib
%%CODEBLOCK5%%js
import * as rl from 'raylib/drm/index.js'
const rl = require('raylib/drm')
%%CODEBLOCK6%% bash
# Unix
./bin/node-raylib core_basic_window.js
# Windows
node bin/node-raylib core_basic_window.js
%%CODEBLOCK7%% bash
npm install raylib --global
node-raylib --version
npx -y raylib --version
%%CODEBLOCK8%%
git clone https://github.com/RobLoach/node-raylib.git
cd node-raylib
npm i
npm t
%%CODEBLOCK9%%
npm run pkg
``
node-raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check LICENSE for further details.
Copyright (c) 2022 Rob Loach (@RobLoach)