G.js lets you create fully-featured Geometry Dash levels using JavaScript. Instead of placing triggers by hand in the editor, you write code — defining groups, colors, trigger functions, counters, events, and more — then export directly to your GD savefile, live editor, or a level string.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/g-js-api/G.js/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Install via npm and get your first script ready to run.
Quickstart
Build a moving text loop in under 30 lines of JavaScript.
Core Concepts
Understand objects, triggers, groups, colors, and contexts.
API Reference
Full reference for every exported function, class, and constant.
What G.js Does
G.js exposes a global-first API that mirrors Geometry Dash’s trigger system. You create groups withgroup() or unknown_g(), attach movement and logic with trigger methods, and control timing via wait() and trigger functions.
Key Features
Trigger Functions & Contexts
Group triggers into callable functions and manage execution contexts.
Counters & Conditions
Item-based counters with arithmetic, comparisons, and while loops.
Events
React to touch, collision, death, x-position, and frame events.
Camera & Visual Effects
Camera offset, zoom, rotation, static follow, and color triggers.
Particles & Shaders
Particle systems and GD 2.2 shader effects like glitch and chromatic.
Keyframe Animations
Animate groups across position, rotation, and scale with keyframes.
Export Modes
G.js supports four export targets:| Mode | Description |
|---|---|
savefile | Writes directly to your GD save file |
live_editor | Streams to the in-game editor via WSLiveEditor |
levelstring | Returns the raw GD level string |
gmd | Exports to a .gmd file |
Configure export
Call
$.exportConfig() at the top of your script to set the export target and options.Add objects and triggers
Use
group(), trigger_function(), counter(), on(), and the rest of the API to build your level.G.js requires Node.js and works on Windows, macOS, Linux, and Android. Join the Discord server for help and community examples.