- Learn
- Build a Game
- Shatterfield
- Appendices
- C Cheat Sheet
Appendix C — Cheat Sheet
Every Event and Action Shatterfield uses, with what it does in one line, in Myth’s own words. (The 5 template Logic Components, Rotate-and-thrust Controls, Wrap Around World, Motion Facing, Random Teleport and Menu Pause Lifecycle, are not included: they come whole.)
C.1 Events
- 2D Direction Held
- Runs every simulation step while the selected Left, Right, Up, or Down direction is held.
- 2D Direction Released
- Runs once when the selected Left, Right, Up, or Down direction is released.
- Collision
- Runs when this instance overlaps or collides with the selected object.
- Collision Enter
- Runs once when this instance starts colliding or overlapping with the selected object.
- Command Pressed
- Runs once when the selected Button Command matches its Single, Double, or Triple Press pattern.
- Create
- Runs once when an instance is created.
- Custom Event
- Runs when another action or script triggers the selected named custom event.
- Destroy
- Runs when an instance is destroyed.
- End Step
- Runs at the end of each game step, after regular Step events.
- Game Start
- Runs once when the game starts.
- Game State Changed
- Runs after the singular project Game State changes.
- Leave View
- Runs once when this instance leaves all active camera views.
- No Instances Left
- Runs on every listener when the last live instance of the selected Object is destroyed.
- On Disable
- Runs once after this Logic changes from enabled to disabled.
- On Enable
- Runs once after this Logic changes from disabled to enabled.
- Recurring Timer
- Runs each time the named recurring timer comes due.
- Step
- Runs every game step while the instance exists.
- Variable Changed
- Runs once, at the end of a step, after the selected Global Variable changes value.
C.2 Actions
- Burst Particles
- Emits a one-shot Particle effect at the Object origin, a named Coordinate, a bounding-box anchor, or an explicit world position.
- Camera Shake
- Shakes the camera — impacts, explosions, spells.
- Change Component Value
- Changes one mutable Object Component value through its direct path.
- Change Variable
- Changes one declared variable: a Local Variable of this Logic (private to this Logic Component, or to this call of a Function), a Per Instance Variable of the targeted Object (self.name), a Changeable Shared Variable (@self.name, @Guard.name: one value for every instance of that Object), or a Global.
- Check Cooldown Ready
- The produced Boolean can be referenced directly by a later If, While, or value expression.
- Check Game State
- Runs nested actions while the singular project Game State matches the selected value.
- Check Instance Count
- The produced Boolean can be referenced directly by a later If, While, or value expression.
- Check Menu Open
- True while any menu (or the named one) is the open, focused menu.
- Control Sound
- Plays, loops, crossfades, or stops one selected Sound resource.
- Create Instance
- Creates one instance at world XYZ, Self-relative XYZ, or an exact named Coordinate, and names it (Created As).
- Declare Variable
- Brings a Local Variable into existence.
- Destroy Instance
- Destroys the selected target: Self, Event other, or all live instances of a named Object.
- Else
- Runs the Else action.
- Face Toward
- Immediately faces an Object or resolved position without moving.
- Generate Random Integer
- Makes a whole number between Minimum and Maximum, including both endpoints, using the seeded gameplay random stream.
- Generate Random Number
- Makes a decimal number between Minimum and Maximum using the seeded gameplay random stream.
- If
- Runs its Then branch when its Condition is true.
- Load Persistent Value
- Reads a device-persisted value, or the Default if none is stored yet, and publishes one typed Action result.
- Popup Text
- Floating text that rises and fades - damage numbers, “+10 gold”, “LEVEL UP!”.
- Repeat
- Runs its vertical child stack Count times.
- Save Persistent Value
- Writes one device-persistent value under one title-scoped key.
- Set Alpha
- Sets alpha for the target or game.
- Set Animation Clip
- Changes the animation clip used by this instance.
- Set Background Sliding Speed
- Changes the live sliding velocity.
- Set Direction
- Turns the current velocity without changing its speed.
- Set Frame
- Sets frame for the target or game.
- Set Game State
- Changes the singular project-wide Game State and runs Game State Changed when the value changes.
- Set Logic State
- Enables, disables, or toggles one attached Logic on each target instance, firing lifecycle events only for real state transitions.
- Set Position
- Moves the target immediately to a world position, an Object-local offset, a named Coordinate, or a Transform bounding-box anchor.
- Set Rotation
- Sets the exact planar rotation in degrees.
- Set Speed
- Changes the current velocity magnitude without changing its direction.
- Set Spin
- Sets how fast the object is turning, in degrees per second.
- Set Sprite
- Changes the sprite resource.
- Set UI Group Visibility
- Shows or hides every UI Object with the same non-empty Group value.
- Set Velocity
- Sets the exact horizontal velocity, vertical velocity, or both.
- Set Visible
- Sets visible for the target or game.
- Start Cooldown
- Starts a named cooldown on the target instance.
- Start Recurring Timer
- Starts or restarts one saveable named recurring timer.
- Stop Recurring Timer
- Stops one named recurring timer.
- Switch Mode
- Sets the Event to One at a time and turns on only the selected Mode.
- Trigger Custom Event
- Broadcasts one named Custom Event to matching Custom Event listeners.
- Trigger Custom Event on Object
- Sends one named Custom Event to the selected Object instance without broadcasting it to unrelated Objects.
C.3 Reading Values From Tables
data('table', row, 'column')- the value in one cell: the row by its name or number, the column by its name.
dataFind('table', 'column', value)- the number of the first row whose column holds this value.
dataCount('table')- how many rows the table has.
