Requires
Classes
- Context
Namespaces
- $
- level
Members
(inner) animations :animations
- Description:
- Object containing various animation IDs for big beast, bat, and spikeball.
- Source:
Object containing various animation IDs for big beast, bat, and spikeball.
Type:
Methods
(inner) blocking_trigger_fn(callback) → {group}
- Description:
- A type of trigger function that, when called, lets you block all other triggers until a trigger function stops executing.
- Source:
Parameters:
| Name |
Type |
Description |
callback |
function
|
Trigger function; callback provides parameter `stop_exec` that lets you stop blocking at a specific place. |
Returns:
Group ID of trigger function
-
Type
-
group
(inner) exportConfig(conf) → {null|string}
- Description:
- One-size-fits-all function for exporting a level to GD
- Source:
Parameters:
| Name |
Type |
Description |
conf |
export_config
|
Configuration for exporting level |
Returns:
Levelstring if using "levelstring" type, otherwise null
-
Type
-
null
|
string
- Description:
- Extracts values from dictionary into global scope
- Source:
Parameters:
| Name |
Type |
Description |
dict |
dictionary
|
Dictionary to extract |
(inner) hsv(hue, sat, bright, sat_checked, bright_checked) → {string}
- Description:
- Generates the HVS string from an HSV color
- Source:
Parameters:
| Name |
Type |
Default |
Description |
hue |
number
|
|
|
sat |
number
|
|
|
bright |
number
|
|
|
sat_checked |
boolean
|
false
|
|
bright_checked |
boolean
|
false
|
|
Returns:
Resulting HVS string (used in HVS and COLOR_2_HVS)
-
Type
-
string
(inner) ignore_context_change(fn)
- Description:
- Ignores context changes inside of a function
- Source:
Parameters:
| Name |
Type |
Description |
fn |
function
|
Function containing code where context changes should be ignored |
(inner) object(dict) → {object}
- Description:
- Takes a dictionary with object props & converts into an object
- Source:
Parameters:
| Name |
Type |
Description |
dict |
dictionary
|
Dictionary to convert to object |
Returns:
-
Type
-
object
(inner) range(start, end, step) → {array}
- Description:
- Generates an array holding a sequence of numbers starting at the "start" parameter, ending at the "end" parameter and incrementing by "step"
- Source:
Parameters:
| Name |
Type |
Default |
Description |
start |
number
|
|
What number to start at |
end |
number
|
|
What number to end at |
step |
number
|
1
|
What number to increment by |
Returns:
Resulting sequence
-
Type
-
array
(inner) speed() → {number}
- Description:
- Calculates units per second based on an input player speed
- Source:
Properties:
| Name |
Type |
Description |
speed |
number
|
The player speed (e.g. 0.5 for half, 1 for normal, 2 for double, 3 for 3x speed, etc.) |
Returns:
The units per second of the player
-
Type
-
number
(inner) trigger(dict) → {object}
- Description:
- Takes a dictionary with object props & converts into a trigger
- Source:
Parameters:
| Name |
Type |
Description |
dict |
dictionary
|
Dictionary to convert to trigger |
Returns:
-
Type
-
object
(inner) trigger_function(callback) → {group}
- Description:
- Creates a "trigger function" in which triggers can be stored inside of a single group
- Source:
Parameters:
| Name |
Type |
Description |
callback |
function
|
Function storing triggers to put inside of group |
Returns:
Group ID of trigger function
-
Type
-
group
(inner) unknown_b() → {block}
- Description:
- Creates and returns an unavailable block ID
- Source:
Returns:
Resulting block ID
-
Type
-
block
(inner) unknown_c() → {color}
- Description:
- Creates and returns an unavailable color ID
- Source:
Returns:
Resulting color ID
-
Type
-
color
(inner) unknown_g() → {group}
- Description:
- Creates and returns an unavailable group ID
- Source:
Returns:
Resulting group ID
-
Type
-
group
(inner) wait(time)
- Description:
- Waits for a specific amount of seconds
- Source:
Parameters:
| Name |
Type |
Description |
time |
number
|
How long to wait |
(inner) while_loop(condition, func, delay)
- Description:
- Creates a repeating trigger system that repeats while a condition is true
- Source:
Parameters:
| Name |
Type |
Description |
condition |
condition
|
Condition that defines whether the loop should keep on running (less_than/equal_to/greater_than(counter, number)) |
func |
function
|
Function to run while the condition is true |
delay |
number
|
Delay between each cycle |
Type Definitions
animations
- Source:
Properties:
| Name |
Type |
Description |
big_beast |
big_beast_animations
|
Animation identifiers for big beast |
bat |
bat_animations
|
Animation identifiers for bat |
spikeball |
spikeball_animations
|
Animation identifiers for spikeball |
Type:
bat_animations
- Source:
Properties:
| Name |
Type |
Description |
idle01 |
number
|
Identifier for the first idle animation |
idle02 |
number
|
Identifier for the second idle animation |
idle03 |
number
|
Identifier for the third idle animation |
attack01 |
number
|
Identifier for the first attack animation |
attack02 |
number
|
Identifier for the second attack animation |
attack02_end |
number
|
Identifier for the end of the second attack animation |
sleep |
number
|
Identifier for the sleep animation |
sleep_loop |
number
|
Identifier for the sleep loop animation |
sleep_end |
number
|
Identifier for the end of the sleep animation |
attack02_loop |
number
|
Identifier for the loop of the second attack animation |
Type:
big_beast_animations
- Source:
Properties:
| Name |
Type |
Description |
bite |
number
|
Identifier for the bite animation |
attack01 |
number
|
Identifier for the first attack animation |
attack01_end |
number
|
Identifier for the end of the first attack animation |
idle01 |
number
|
Identifier for the first idle animation |
Type:
context
- Source:
Properties:
| Name |
Type |
Description |
name |
string
|
Name of the current context |
group |
group
|
Group representing the current context |
objects |
array
|
All objects in the current context |
children |
array
|
Child contexts |
Type:
easing
- Source:
Properties:
| Name |
Type |
Description |
EASE_IN_OUT |
number
|
Ease in out easing |
EASE_IN |
number
|
Ease in easing |
EASE_OUT |
number
|
Ease out easing |
EXPONENTIAL_IN_OUT |
number
|
Exponential in out easing |
EXPONENTIAL_IN |
number
|
Exponential in easing |
EXPONENTIAL_OUT |
number
|
Exponential out easing |
SINE_IN_OUT |
number
|
Sine in out easing |
SINE_IN |
number
|
Sine in easing |
SINE_OUT |
number
|
Sine out easing |
ELASTIC_IN_OUT |
number
|
Elastic in out easing |
ELASTIC_IN |
number
|
Elastic in easing |
ELASTIC_OUT |
number
|
Elastic out easing |
BACK_IN_OUT |
number
|
Back in out easing |
BACK_IN |
number
|
Back in easing |
BACK_OUT |
number
|
Back out easing |
BOUNCE_IN_OUT |
number
|
Bounce in out easing |
BOUNCE_IN |
number
|
Bounce in easing |
BOUNCE_OUT |
number
|
Bounce out easing |
Type:
export_config
- Source:
Properties:
| Name |
Type |
Description |
type |
string
|
Type of export (can be "levelstring", "savefile", "live_editor" or "gmd") |
options |
save_config
|
Configuration for specific export type |
Type:
obj_ids
- Description:
- Object containing various IDs for objects, triggers, and portals.
- Source:
Properties:
| Name |
Type |
Description |
special |
Object.<string, number>
|
Special / non-trigger objects (blocks, displays, collision helpers, etc.). |
triggers |
Object.<string, number>
|
Trigger object IDs used for events, logic, camera control, effects,
gameplay manipulation, and state changes. |
portals |
Object.<string, number>
|
Portal object IDs that change player form, speed, gravity, size,
dual mode, or other movement rules. |
Object containing various IDs for objects, triggers, and portals.
Type:
object
- Source:
Properties:
| Name |
Type |
Description |
type |
string
|
String dictating that the type of the resulting dictionary is an object |
obj_props |
dictionary
|
Dictionary inside of object holding the actual object properties of the object |
with |
function
|
Modifies/adds an object property (e.g. `object.with(obj_props.X, 15)`) |
add |
function
|
Adds the object |
Type:
save_config
- Description:
- Configuration for exporting levels.
- Source:
Properties:
| Name |
Type |
Attributes |
Default |
Description |
info |
boolean
|
<optional>
|
false
|
Whether to log information to console when finished |
group_count_warning |
boolean
|
<optional>
|
true
|
Whether to warn that group count is surpassed (only useful if in future updates the group count is increased) |
level_name |
string
|
<optional>
|
by default, it writes to your most recent level/topmost level
|
Name of level (only for exportToSavefile) |
path |
string
|
<optional>
|
path to savefile automatically detected based on OS, or required path to .gmd file
|
Path to CCLocalLevels.dat savefile, or path to .gmd input file (only for exportToSavefile and gmd types) |
reencrypt |
boolean
|
<optional>
|
true
|
Whether to reencrypt savefile after editing it, or to let GD encrypt it |
optimize |
boolean
|
<optional>
|
true
|
Whether to optimize unused groups & triggers that point to unused groups |
replacePastObjects |
boolean
|
<optional>
|
true
|
Whether to delete all objects added by G.js in the past & replace them with the new objects |
removeGroup |
number
|
group
|
<optional>
|
9999
|
Group to use to mark objects to be automatically deleted when re-running the script (default is 9999) |
triggerPositioningAllowed |
boolean
|
<optional>
|
true
|
Whether to allow G.js to automatically position added triggers |
trigger_pos_start |
number
|
<optional>
|
6000
|
The Y position (small-step units) where triggers should start being placed |
gmdOutput |
string
|
<optional>
|
path
|
The location to a .gmd output file, by default is equal to `path` option (only for gmd mode) |
Configuration for exporting levels.
Type:
spikeball_animations
- Source:
Properties:
| Name |
Type |
Description |
idle01 |
number
|
Identifier for the first idle animation |
idle02 |
number
|
Identifier for the second idle animation |
toAttack01 |
number
|
Identifier for the transition to the first attack animation |
attack01 |
number
|
Identifier for the first attack animation |
attack02 |
number
|
Identifier for the second attack animation |
toAttack03 |
number
|
Identifier for the transition to the third attack animation |
attack03 |
number
|
Identifier for the third attack animation |
idle03 |
number
|
Identifier for the third idle animation |
fromAttack03 |
number
|
Identifier for the transition from the third attack animation |
Type: