- Learn
- Build a Game
- Shatterfield
- Appendices
- B Message Map
Appendix B — Message Map
Shatterfield is built on messages (Custom Events): one piece of the game announces something, and the pieces that care listen. This map shows every message in the game: who sends it, who it goes to, and who hears it. A message must be spelled exactly the same where it is sent and where it is heard; this is the place to check.
Two ways to send. Trigger Custom Event goes to everyone who listens (a broadcast). The game sends its news this way (a wave beginning or cleared, the game paused, a Ship lost), so a listener hears it whichever Object it is attached to.
Trigger Custom Event on Object goes to one Object only: the Object touched (hit), the Object a Variable names (startBlinking to a prompt), or the sender’s own Object. A message to its own Object is heard by every Logic Component on that Object and by nothing else, so its sender and its listener must stay on the same Object. The game uses it for the parts of one Object (this Ship’s Ship Shield tells its Ship Crash shieldUp; Ship Hyperspace tells the Ship’s Random Teleport to jump), and for a component that runs one of its own Events from two places (Lives and Respawn’s spawnShip, Title Screen’s showTitle, Break Apart’s breakUp).
B.1 Chains to Follow
Read each line left to right: a message, the Logic (in bold) that hears it and sends the next message, and at the end the Logic that hears the last one.
- gameResumed → Pause → hideMenu → Menu Pause Lifecycle
- hit → Break Apart → breakUp → Break Apart
- hit → Break Apart → scored → Score, Extra Ships
- hit → Saucer Explodes → scored → Score, Extra Ships
- showTitle → Title Screen → startBlinking → Blink
- showTitle → Title Screen → clearField → Leave When Cleared
B.2 All Messages, in the Order the Build Adds Them
| Message | Sent by | Goes to | Heard by | Chapter |
|---|---|---|---|---|
| randomTeleport | Ship Hyperspace (on Ship) | its own Object only | Random Teleport (on Ship) | 3 |
| hit | Shot Impact (on Shot); Ship Crash (on Ship) | the Object it touched | Break Apart (on Asteroid Large, Asteroid Medium, Asteroid Small); Saucer Explodes (on Saucer Large, Saucer Small); Saucer Shot Flight (on Saucer Orb, Saucer Lance) | 4 |
| shieldDown | Ship Shield (on Ship) | its own Object only | Ship Crash (on Ship) | 5 |
| shieldUp | Ship Shield (on Ship) | its own Object only | Ship Crash (on Ship) | 5 |
| shipDestroyed | Ship Crash (on Ship) | everyone who listens | Lives and Respawn (on Game Rules) | 5 |
| nextWave | Waves (on Game Rules) | everyone who listens | Waves (on Game Rules); Sky Parallax (on Game Rules) | 6 |
| scored | Break Apart (on Asteroid Large, Asteroid Medium, Asteroid Small); Saucer Explodes (on Saucer Large, Saucer Small) | everyone who listens | Score (on Game Rules); Extra Ships (on Game Rules) | 7 |
| breakUp | Break Apart (on Asteroid Large, Asteroid Medium, Asteroid Small); Saucer Shot Flight (on Saucer Orb, Saucer Lance) | its own Object only; the Object it touched | Break Apart (on Asteroid Large, Asteroid Medium, Asteroid Small) | 8 |
| clearField | Title Screen (on Game Rules); Start Game (on Game Rules) | everyone who listens | Leave When Cleared (on Shot, Asteroid Large, Asteroid Medium, Asteroid Small, Saucer Orb, Saucer Lance, Saucer Large, Saucer Small, Title Asteroid) | 9 |
| gamePaused | Pause (on Game Rules) | everyone who listens | Thrust Feedback (on Ship); Saucer Flight (on Saucer Large, Saucer Small) | 9 |
| gameResumed | the Paused button | everyone who listens | Thrust Feedback (on Ship); Saucer Flight (on Saucer Large, Saucer Small); Pause (on Game Rules) | 9 |
| hideMenu | Pause (on Game Rules) | everyone who listens | Menu Pause Lifecycle (on Game Rules) | 9 |
| playStopped | Play Switch (on Game Rules) | everyone who listens | Saucer Flight (on Saucer Large, Saucer Small); Saucer Gun (on Saucer Large, Saucer Small); Sky Parallax (on Game Rules) | 9 |
| showPausedMenu | Pause (on Game Rules) | everyone who listens | Menu Pause Lifecycle (on Game Rules) | 9 |
| showTitle | Title Screen (on Game Rules) | its own Object only | Title Screen (on Game Rules) | 9 |
| spawnShip | Lives and Respawn (on Game Rules) | its own Object only | Lives and Respawn (on Game Rules) | 9 |
| startBlinking | Title Screen (on Game Rules); Game Over Screen (on Game Rules) | the Object in its prompt Variable; the Object in its playAgainPrompt Variable | Blink (on Title Prompt, Play Again Prompt) | 9 |
| stopBlinking | Title Screen (on Game Rules); Game Over Screen (on Game Rules) | the Object in its prompt Variable; the Object in its playAgainPrompt Variable | Blink (on Title Prompt, Play Again Prompt) | 9 |
| waveCleared | Waves (on Game Rules) | everyone who listens | Heartbeat (on Game Rules); Sky Parallax (on Game Rules) | 10 |
| waveStarted | Waves (on Game Rules) | everyone who listens | Heartbeat (on Game Rules) | 10 |
From here on, each message has a list of its own, under the chapter that adds it. The name in quotes is the Mode that sends or hears it. An Event with only one Mode has it under its Logic Component’s name.
B.3 Chapter 3: Hyperspace
B.3.1 randomTeleport
- Sent by Ship Hyperspace (on Ship), in “When Hyperspace Is Pressed”, to its own Object only.
- Heard by Random Teleport (on Ship): “On Random Teleport”.
B.4 Chapter 4: Asteroids
B.4.1 hit
- Sent by Shot Impact (on Shot), in “When Starting to Hit Anything”, to the Object it touched.
- Sent by Ship Crash (on Ship), in “While Hitting Anything” (in its Exposed mode), to the Object it touched.
- Heard by Break Apart (on Asteroid Large, Asteroid Medium, Asteroid Small): “On Hit”.
- Heard by Saucer Explodes (on Saucer Large, Saucer Small): “On Hit”.
- Heard by Saucer Shot Flight (on Saucer Orb, Saucer Lance): “On Hit”.
B.5 Chapter 5: Crash and Lives
B.5.1 shieldDown
- Sent by Ship Shield (on Ship), in “On the Shield Time Timer”, to its own Object only.
- Heard by Ship Crash (on Ship): “On Shield Down”.
B.5.2 shieldUp
- Sent by Ship Shield (on Ship), in “When Created”, to its own Object only.
- Heard by Ship Crash (on Ship): “On Shield Up”.
B.5.3 shipDestroyed
- Sent by Ship Crash (on Ship), in “While Hitting Anything” (in its Exposed mode), to everyone who listens.
- Heard by Lives and Respawn (on Game Rules): “On Ship Destroyed”.
B.6 Chapter 6: Waves
B.6.1 nextWave
- Sent by Waves (on Game Rules), in “When Enabled”, to everyone who listens.
- Sent by Waves (on Game Rules), in “On the Sector Jump Timer”, to everyone who listens.
- Heard by Waves (on Game Rules): “On Next Wave”.
- Heard by Sky Parallax (on Game Rules): “On Next Wave”.
B.7 Chapter 7: Score
B.7.1 scored
- Sent by Break Apart (on Asteroid Large, Asteroid Medium, Asteroid Small), in “On Hit”, to everyone who listens.
- Sent by Saucer Explodes (on Saucer Large, Saucer Small), in “On Hit”, to everyone who listens.
- Heard by Score (on Game Rules): “On Scored”.
- Heard by Extra Ships (on Game Rules): “On Scored”.
B.8 Chapter 8: Saucers
B.8.1 breakUp
- Sent by Break Apart (on Asteroid Large, Asteroid Medium, Asteroid Small), in “On Hit”, to its own Object only.
- Sent by Saucer Shot Flight (on Saucer Orb, Saucer Lance), in “When Starting to Hit Asteroid”, to the Object it touched.
- Heard by Break Apart (on Asteroid Large, Asteroid Medium, Asteroid Small): “On Break Up”.
B.9 Chapter 9: Screens
B.9.1 clearField
- Sent by Title Screen (on Game Rules), in “On Show Title”, to everyone who listens.
- Sent by Start Game (on Game Rules), in “When Start Is Pressed”, to everyone who listens.
- Heard by Leave When Cleared (on Shot, Asteroid Large, Asteroid Medium, Asteroid Small, Saucer Orb, Saucer Lance, Saucer Large, Saucer Small, Title Asteroid): “On Clear Field”.
B.9.2 gamePaused
- Sent by Pause (on Game Rules), in “When Pause Is Pressed”, to everyone who listens.
- Heard by Thrust Feedback (on Ship): “On Game Paused”.
- Heard by Saucer Flight (on Saucer Large, Saucer Small): “On Game Paused”.
B.9.3 gameResumed
- Sent by the Paused button, when chosen, to everyone who listens.
- Heard by Thrust Feedback (on Ship): “On Game Resumed”.
- Heard by Saucer Flight (on Saucer Large, Saucer Small): “On Game Resumed”.
- Heard by Pause (on Game Rules): “On Game Resumed”.
B.9.5 playStopped
- Sent by Play Switch (on Game Rules), in “On Game State Changed”, to everyone who listens.
- Heard by Saucer Flight (on Saucer Large, Saucer Small): “On Play Stopped”.
- Heard by Saucer Gun (on Saucer Large, Saucer Small): “On Play Stopped”.
- Heard by Sky Parallax (on Game Rules): “On Play Stopped”.
B.9.7 showTitle
- Sent by Title Screen (on Game Rules), in “When the Game Starts”, to its own Object only.
- Sent by Title Screen (on Game Rules), in “On Game State Changed”, to its own Object only.
- Heard by Title Screen (on Game Rules): “On Show Title”.
B.9.8 spawnShip
- Sent by Lives and Respawn (on Game Rules), in “When Enabled”, to its own Object only.
- Sent by Lives and Respawn (on Game Rules), in “On the Respawn Delay Timer”, to its own Object only.
- Heard by Lives and Respawn (on Game Rules): “On Spawn Ship”.
B.9.9 startBlinking
- Sent by Title Screen (on Game Rules), in “On Show Title”, to the Object in its prompt Variable.
- Sent by Game Over Screen (on Game Rules), in “On Game State Changed”, to the Object in its playAgainPrompt Variable.
- Heard by Blink (on Title Prompt, Play Again Prompt): “On Start Blinking”.
B.9.10 stopBlinking
- Sent by Title Screen (on Game Rules), in “On Game State Changed”, to the Object in its prompt Variable.
- Sent by Game Over Screen (on Game Rules), in “On Game State Changed”, to the Object in its playAgainPrompt Variable.
- Heard by Blink (on Title Prompt, Play Again Prompt): “On Stop Blinking”.
B.10 Chapter 10: Heartbeat
B.10.1 waveCleared
- Sent by Waves (on Game Rules), in “On No Instances Left · Asteroid”, to everyone who listens.
- Heard by Heartbeat (on Game Rules): “On Wave Cleared”.
- Heard by Sky Parallax (on Game Rules): “On Wave Cleared”.
B.10.2 waveStarted
- Sent by Waves (on Game Rules), in “On the Banner Time Timer”, to everyone who listens.
- Heard by Heartbeat (on Game Rules): “On Wave Started”.
B.11 Game State Changes (Sent by the Engine)
Set Game State makes the engine send Game State Changed to everyone who listens.
- Lives and Respawn sets Game Over in “On Ship Destroyed”.
- Start Game sets Playing in “When Start Is Pressed”.
- Game Over Screen sets Play Again in “On the Play Again Delay Timer”.
- Game Over Screen sets Title in “On the Return to Title Timer”.
- Heard by: Score, Title Screen, Game Over Screen, Play Switch.
