Skip to main content
The Side class represents one of the six faces of a Block. Every side has its own identity, spatial vectors, and may hold an item or a decoration. Scripts attached to a side receive it as self in hooks such as OnBallRoll, and the ball’s current ground side is always available via ball.currentGroundSide. RollingQuest defines many typed sub-classes of Side — for example SideButton or SideLaser — each inheriting all base properties while adding their own.

Properties

Identity

Transform

Geometry

Rules

Attachments

Methods

getAssociatedBasis

Returns the Basis that corresponds to a ball standing on this side at a given orientation. Three overloads are available:

isDirectionBlocked

Returns true when the given orientation is a blocked movement direction for the ball on this side.

Type-cast helpers

Use these to narrow a generic entity reference to a concrete type. Each throws an error if the cast is invalid.

SideData

SideData is the raw, mutable representation used when constructing level data (e.g. in OnLevelLoad). It carries the optional template, scriptRef, scriptTag, scriptVars, and properties fields, plus references to an ItemData and a DecorationData. The boolean flags hasOwnTemplate, hasValidItem, and hasValidDecoration let you check which optional fields are populated. Key SideData methods: clearItem(), clearDecoration(), clear().

Side Subtypes

The following concrete sub-classes all inherit every property and method from Side. You receive the most-specific type automatically when accessing sides at runtime.

Custom Events

Many Side sub-classes emit built-in custom events. Listen for them with the OnCustomEvent hook and dispatch on event.name.

Usage Example

The following OnBallRoll hook is attached to a side script and prints the face name every time the ball rolls onto the side: