Block class represents a single block in the RollingQuest game world — the fundamental building unit that the ball rolls across. Scripts attached to a block receive it as self in hooks such as OnBallRoll and OnBallLand. From a Block reference you can inspect every side and neighboring block, read movement state, toggle tangibility, and mark the block as visited.
Related types: Each side of a block is aSideinstance. The block’s grid position is described by aBlockSlot. The raw data representation used at level-build time isBlockData.
Identity
Transform
Sides
Each face of the block is exposed as a direct property and also viagetSide.
Neighbors
State
Methods
getSide
Side corresponding to the given Face enum value. Useful when the face is determined at runtime.
markAsVisited
enable / disable
Type-cast helpers
Call these to narrow a generic entity reference to a specific type. Each throws an error if the cast is invalid.BlockData
BlockData is the raw, mutable representation of a block used when building or modifying level data (e.g. in OnLevelLoad). It holds the grid coordinates x, y, z, a SideData for each of the six faces (up, down, left, right, front, back), and the scripting fields template, scriptRef, scriptTag, scriptVars, and properties.
Key BlockData methods:
getSides()— returns a table of all sixSideDatavalues in order: Up, Down, Left, Right, Front, Back.getSidesIterator()— returns an iterator-compatible version of the same sequence.clear()— resets the block data to empty defaults.
BlockSlot
BlockSlot identifies a block’s integer grid coordinate (x, y, z) within a section. You can obtain the world-space Vector3 from slot.position. Use BlockSlot.new(x, y, z) to construct a slot, and slot:translate(dx, dy, dz) or slot:translateFromBasis(basis, dx, dy, dz) to compute offsets.
Custom Events
SeveralBlock sub-classes emit built-in custom events. Listen for them with the OnCustomEvent hook and dispatch on event.name.
Usage Example
TheOnBallRoll hook fires each time the ball moves onto a new side. The example below disables a block when it has been visited three times by incrementing a counter stored in localData: