Command Reference
Unlock the full potential of GridX. Use these commands to build powerful scripts. Click any card to expand for details and code examples.
open_with Core Movement
Standard
expand_more
Moves the player exactly one grid unit. If the move is invalid (e.g. hitting a wall), the execution will crash and stop. Supports both full names and shorthands.
player.move('right'); // Full version
player.move('u'); // Shorthand for Up
Express
expand_more
A high-speed alternative that moves the character two cells in
a single command. Equivalent to calling
move() twice.
player.run('down');
player.run('l'); // Fast left navigation
touch_app Interactions
Action
expand_more
Used to collect items (like keys) that are on the same cell as the player.
player.take('key'); // Picks up the key
Action
expand_more
Opens a locked door. You must be adjacent to the door or directly on it, and have already collected a key.
player.open('door');
Physics
expand_more
If you are standing directly next to a box, this pushes the box 1 space away from you. Box cannot be pushed into walls or boundaries.
player.push('box');
Physics
expand_more
If you are standing directly next to a box, you take a step backward and drag the box into the space you just left.
player.pull('box');
memory Programmable Logic
Detection
expand_more
Returns true if the cell in the specified
direction is within the grid boundaries and accessible. Use it
to avoid crashing.
if (canMove('right')) {
player.move('right');
}
Looping
expand_more
A high-level loop command that repeats all instructions inside
the curly braces N times. This keeps your code
clean and manageable.
for(5) {
player.move('r');
player.move('d');
}
Decisions
expand_more
Control the flow of your script based on conditions. The
else block is optional and executes if the
condition is false.
if (canMove('up')) { player.move('u'); } else { player.move('r'); }
Structure
expand_more
Define custom functions to group commands together. Call your function anywhere in the script to avoid repeating code.
function moveAngle() {
player.move('r');
player.move('d');
}
moveAngle();
explore Direction Aliases
Right
'right' or 'r'
Left
'left' or 'l'
Up
'up' or 'u'
Down
'down' or 'd'