All Projects → RobLoach → node-raylib

RobLoach / node-raylib

Licence: other
Node.js bindings for Raylib

Programming Languages

c
50402 projects - #5 most used programming language
javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to node-raylib

raylib-lua
A modern LuaJIT binding for Raylib (also available at https://gitlab.com/TSnake41/raylib-lua)
Stars: ✭ 47 (-69.87%)
Mutual labels:  raylib
ruck
🧬 Modularised Evolutionary Algorithms For Python with Optional JIT and Multiprocessing (Ray) support. Inspired by PyTorch Lightning
Stars: ✭ 50 (-67.95%)
Mutual labels:  raylib
raylib-nuklear
Nuklear immediate mode GUI for raylib
Stars: ✭ 47 (-69.87%)
Mutual labels:  raylib
nelua-game2048
Clone of the 2048 game in Nelua using Raylib
Stars: ✭ 16 (-89.74%)
Mutual labels:  raylib
Raylib
A simple and easy-to-use library to enjoy videogames programming
Stars: ✭ 8,169 (+5136.54%)
Mutual labels:  raylib
FNode
Tool based in nodes to build GLSL shaders without any programming knowledge written in C using OpenGL and GLFW.
Stars: ✭ 81 (-48.08%)
Mutual labels:  raylib
cl-raylib
Common Lisp binding of raylib
Stars: ✭ 72 (-53.85%)
Mutual labels:  raylib
GameSystemsInC
Game systems for games in C. Examples using Raylib.
Stars: ✭ 16 (-89.74%)
Mutual labels:  raylib
raster-master
Raster Master Sprite/Icon/Map editor for Windows 10/11 that generates RayLib code / Put image and map code for Open Watcom, gcc, AmigaBASIC, Amiga C, Amiga Pascal ,QuickBasic, QB64, Quick C, Turbo Pascal, freepascal, Turbo C, Turbo Basic, Power Basic, FreeBASIC, GWBASIC, BASICA, PC-BASIC,, DOS XLIB LBM/PBM
Stars: ✭ 40 (-74.36%)
Mutual labels:  raylib
ecs
Build your own Game-Engine based on the Entity Component System concept in Golang.
Stars: ✭ 68 (-56.41%)
Mutual labels:  raylib
awesome-raylib
Curated list of awesome stuff for raylib.
Stars: ✭ 208 (+33.33%)
Mutual labels:  raylib
raylib-cpp-starter
A portable, automated template for raylib projects with C++ bindings
Stars: ✭ 32 (-79.49%)
Mutual labels:  raylib
raylua
Cross-Platform, Modern, And updated LuaJIT bindings for raylib library.
Stars: ✭ 77 (-50.64%)
Mutual labels:  raylib
tbag
Tea-bag is Third party extension utility project
Stars: ✭ 13 (-91.67%)
Mutual labels:  raylib
Raylib-Forever
:.raylib headers for Nim anytime.:
Stars: ✭ 63 (-59.62%)
Mutual labels:  raylib
raylib-nelua
Raylib wrapper to nelua language
Stars: ✭ 27 (-82.69%)
Mutual labels:  raylib
rPBR
Physically based rendering (PBR) for raylib
Stars: ✭ 72 (-53.85%)
Mutual labels:  raylib
raylib-physfs
Integrate PhysFS with raylib to load images, audio, and fonts, from .zip files.
Stars: ✭ 21 (-86.54%)
Mutual labels:  raylib
learn-dlang
Learn D programming language by creating games!
Stars: ✭ 42 (-73.08%)
Mutual labels:  raylib
nelua-tetris
Tetris game clone made in Nelua with Raylib
Stars: ✭ 16 (-89.74%)
Mutual labels:  raylib

node-raylib Logo

node-raylib npm version Tests

Node.js bindings for raylib, a simple and easy-to-use library to enjoy videogames programming (www.raylib.com).

Examples

Name Description Author
Offical Examples Ports of raylib's examples to node-raylib @RobLoach, @twunky, @kunsumer
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

Dependencies

Usage

  1. Create a new Node.js project:

    mkdir myexample
    cd myexample
  2. Create a package.json file with:

    {
      "dependencies": {
        "raylib": "*"
      },
      "scripts": {
          "start": "node index.js"
      }
    }
  3. Create a index.js JavaScript file, like core_basic_window.js:

    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()
  4. Have npm install the dependencies for you:

    npm install
  5. Run index.js through Node.js:

    npm start

    Screenshot

Check for more examples organized by raylib modules.

Installation

Raylib is implemented as bindings with node-addon-api. Bindings are prebuilt for many platforms in Releases. If your platform is not supported by a prebuilt binary, you will need CMake to build the native addon. Windows users building manually will also require MSVC Build Tools 2019, or Visual Studio 2019 with build tools for C/C++.

In general, to install node-raylib locally, use npm:

npm install raylib

CLI

The project comes with a node-raylib command-line tool to run node-raylib files directly:

# Unix
./bin/node-raylib core_basic_window.js

# Windows
node bin/node-raylib core_basic_window.js

The CLI can be installed globally through npm or npx for no-install:

npm install raylib --global
node-raylib --version
npx -y raylib --version

Development

node-addon-api is used to construct the bindings. Raylib provides a header parser that generates a JSON file containing information on the API. The code binding raylib to NodeJS is automatically generated based on this file. For information on how bindings are written for raylib read the documentation. Code generators for the C++ bindings, TypeScript definitions, and JavaScript wrapper functions are found in the tools/generate_templates folder.

Testing

Run the following to run tests...

git clone https://github.com/RobLoach/node-raylib.git
cd node-raylib
npm i
npm t

TypeScript Definitions

Typescript definitions are provided by a generator based on raylib's header parser. See node-raylib-definitions.js for information on how to generate them.

Package

To build the packaged releases, use the following command:

npm run pkg

License

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)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].