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.
👋 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.
-
Make sure you have CMake 3.5+ and Node.js installed.
-
Install Emscripten, as explained on the Emscripten installation instructions:
| 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 1.39.6 |
emsdk install 1.39.6 |
./emsdk activate 1.39.6 |
emsdk activate 1.39.6 |
source ./emsdk_env.sh |
emsdk_env.bat |
- Launch the build from GDevelop.js folder:
cd GDevelop.js
npm install
npm run buildℹ️ Output is created in /path/to/GD/Binaries/embuild/GDevelop.js/ and also copied to GDevelop 5 IDE (
newIDEfolder).
⏱ As the linking (last step) of the build can be very long, you can run
npm run build -- --devto disable temporary optimizations and get a (slightly) faster build.
- You can then launch GDevelop 5 that will use your build of GDevelop.js:
cd ..
cd newIDE/app
npm install
npm startMore information in GDevelop 5 readme.
npm test
The npm build task:
- Creates
Binaries/embuilddirectory, - Launches CMake inside to compile GDevelop with emconfigure to use Emscripten toolchain,
- Updates the glue.cpp and glue.js from Bindings.idl using Emscripten WebIDL Binder,
- Launches the compilation with
make(orninjaon Windows).
See the CMakeLists.txt for the arguments passed to the Emscripten linker.
- The file Bindings.idl describes all the classes available in GDevelop.js.
- Refer to GDevelop documentation for detailed documentation of the original C++ classes.