Files
GDevelop/GDevelop.js

GDevelop.js

This is the port of GDevelop core classes to JavaScript. This allow GDevelop Core libraries to run in a browser or on Node.js.

🎮 GDevelop is a full featured, cross-platform, open-source game development software requiring no programming skills. Download it on the official website.

How to build

👋 Usually if you're working on GDevelop editor or extensions in JavaScript, you don't need rebuilding GDevelop.js. If you want to make changes in C++ extensions or classes, read this section.

Linux/macOS Windows
git clone https://github.com/juj/emsdk.git git clone https://github.com/juj/emsdk.git
cd emsdk cd emsdk
./emsdk update emsdk update
./emsdk install sdk-1.37.37-64bit emsdk install sdk-1.37.37-64bit
./emsdk activate sdk-1.37.37-64bit emsdk activate sdk-1.37.37-64bit
source ./emsdk_env.sh emsdk_env.bat

For up-to-date information, check again Emscripten installation instructions.

  • Launch the build from GDevelop.js folder:
    cd GDevelop.js
    npm install
    npm run build

Output is created in /path/to/GD/Binaries/Output/libGD.js/.

  • You can then launch GDevelop 5 that will use your build of GDevelop.js:
    cd ..
    cd newIDE/app
    npm install
    npm start

More information in GDevelop 5 readme.

Tests

npm test

About the internal steps of compilation

The grunt build task:

  • create Binaries/embuild directory,
  • launch CMake inside to compile GDevelop with Emscripten toolchain file,
  • update the glue.cpp and glue.js from Bindings.idl using Emscripten WebIDL Binder,
  • launch the compilation with make and wrap the generated libGD.js.raw into the final libGD.js file.

It also create a compressed libGD.js.gz file which is handy for distributing the library pre-compressed to web browsers.

Documentation