TutorialsCocktail Shaker Sort

Appendix B — Message Map

Picture Puzzle 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). Trigger Custom Event on Object goes to one Object only; either the sender’s own Object (one Logic telling the next Logic on the same Object that its part is done) or the one Object named by an Object Parameter.

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.

  • resetRequested → Arrange Board → boardArranged → Pieces Home, Show Piece, Lay Out Slot, Player Exchange, Computer Sort, Sort Timer, Slide Piece, Show Whole Picture
  • pieceCountChosen → Arrange Board → shuffleRequested → Arrange Board → boardArranged → Pieces Home, Show Piece, Lay Out Slot, Player Exchange, Computer Sort, Sort Timer, Slide Piece, Show Whole Picture
  • pictureChosen → Arrange Board → shuffleRequested → Arrange Board → boardArranged → Pieces Home, Show Piece, Lay Out Slot, Player Exchange, Computer Sort, Sort Timer, Slide Piece, Show Whole Picture
  • piecePressed → Piece Press → selectionChanged → Show Outline
  • pieceReleased → Piece Press → selectionChanged → Show Outline
  • pieceReleased → Piece Press → pieceChosen → Player Exchange → selectionChanged → Show Outline
  • pieceReleased → Piece Press → piecesDropped → Player Exchange
  • stepRequested → Computer Sort → passFinished → Show Outline
  • stepRequested → Computer Sort → sortEnded → Sort Timer
  • stepRequested → Computer Sort → forwardPassStarted → Lesson Lines
  • stepRequested → Computer Sort → backwardPassStarted → Lesson Lines
  • lessonRequested → Lesson Panel Switch → selectionCanceled → Piece Press → selectionChanged → Show Outline
  • lessonRequested → Lesson Panel Switch → lessonToggled → Show With Lesson Panel, Show Sort Lines
  • pictureUploaded → Upload Picture → lessonCloseRequested → Lesson Panel Switch

B.2 All Messages, in the Order the Build Adds Them

Message Sent by Goes to Heard by Chapter
boardArranged Arrange Board (on Puzzle Rules) everyone who listens Pieces Home (on Puzzle Rules); Show Piece (on Piece); Lay Out Slot (on Piece Outline, Piece); Player Exchange (on Puzzle Rules); Computer Sort (on Puzzle Rules); Sort Timer (on Puzzle Rules); Slide Piece (on Piece); Show Whole Picture (on Whole Picture) 1
boardMade Make Board (on Puzzle Rules) its own Object only Pieces Home (on Puzzle Rules) 1
placedOnBoard Make Board (on Puzzle Rules) the Object it just created Show Piece (on Piece); Lay Out Slot (on Piece Outline, Piece) 1
resetRequested Request Reset (a Function, called by Puzzle Commands, Button Action) the Puzzle Rules Object only Arrange Board (on Puzzle Rules) 1
shuffleRequested Request Shuffle (a Function, called by Puzzle Commands, Button Action); Make Board (on Puzzle Rules); Arrange Board (on Puzzle Rules) the Puzzle Rules Object only; its own Object only Arrange Board (on Puzzle Rules) 1
pieceChosen Choose Slot (a Function, called by Keyboard Focus); Piece Press (on Puzzle Rules) the Puzzle Rules Object only; its own Object only Player Exchange (on Puzzle Rules) 2
piecePressed Piece Pointer (on Piece) the Puzzle Rules Object only Piece Press (on Puzzle Rules); Keyboard Focus (on Puzzle Rules); Who Plays (on Puzzle Rules) 2
pieceReleased Piece Pointer (on Piece) the Puzzle Rules Object only Piece Press (on Puzzle Rules) 2
piecesDropped Piece Press (on Puzzle Rules) its own Object only Player Exchange (on Puzzle Rules) 2
piecesExchanged Make Player Exchange (a Function, called by Player Exchange) everyone who listens Pieces Home (on Puzzle Rules); Show Piece (on Piece); Computer Sort (on Puzzle Rules); Sort Timer (on Puzzle Rules) 2
selectionCanceled Puzzle Commands (on Puzzle Rules); Input Interruptions (on Puzzle Rules); Lesson Panel Switch (on Puzzle Rules) its own Object only Player Exchange (on Puzzle Rules); Piece Press (on Puzzle Rules); Sort Timer (on Puzzle Rules) 2
selectionChanged Move Focus (a Function, called by Keyboard Focus); Clear Selection (a Function, called by Player Exchange); Player Exchange (on Puzzle Rules); Piece Press (on Puzzle Rules); Hide Focus (a Function, called by Keyboard Focus) everyone who listens Show Outline (on Piece Outline) 2
pairCompared Compare Next Pair (a Function, called by Computer Sort) everyone who listens Pieces Home (on Puzzle Rules); Show Piece (on Piece); Show Outline (on Piece Outline); Who Plays (on Puzzle Rules); Show Sort Lines (on Lesson State, Lesson Result); Lesson Lines (on Puzzle Rules) 3
sortCleared Clear Sort (a Function, called by Computer Sort) everyone who listens Show Outline (on Piece Outline); Show Sort Lines (on Lesson State, Lesson Result) 3
stepRequested Request Step (a Function, called by Puzzle Commands, Button Action); Sort Timer (on Puzzle Rules) the Puzzle Rules Object only; its own Object only Computer Sort (on Puzzle Rules) 3
passFinished Computer Sort (on Puzzle Rules) everyone who listens Show Outline (on Piece Outline) 4
backwardPassStarted Computer Sort (on Puzzle Rules) its own Object only Lesson Lines (on Puzzle Rules) 5
clearSelectionRequested Let Computer Play (a Function, called by Sort Timer, Who Plays) the Puzzle Rules Object only Player Exchange (on Puzzle Rules) 5
forwardPassStarted Computer Sort (on Puzzle Rules) its own Object only Lesson Lines (on Puzzle Rules) 5
lessonCloseRequested Close Lesson (on Close Button); Upload Picture (on Puzzle Rules) the Puzzle Rules Object only; its own Object only Lesson Panel Switch (on Puzzle Rules) 5
lessonRequested Request Lesson (a Function, called by Puzzle Commands, Button Action) the Puzzle Rules Object only Lesson Panel Switch (on Puzzle Rules) 5
lessonToggled Close Lesson Panel (a Function, called by Lesson Panel Switch); Lesson Panel Switch (on Puzzle Rules) everyone who listens Show With Lesson Panel (on Lesson Panel, Lesson Title, Lesson Line, Close Button); Show Sort Lines (on Lesson State, Lesson Result) 5
pauseRequested Request Step (a Function, called by Puzzle Commands, Button Action); Let Player Play (a Function, called by Choose Slot, Who Plays) the Puzzle Rules Object only Sort Timer (on Puzzle Rules) 5
pictureChosen Use Picture (a Function, called by Choose Picture, Upload Picture) everyone who listens Arrange Board (on Puzzle Rules); Show Picture (on Picture Preview, Whole Picture) 5
pictureUploaded Upload Picture (on Puzzle Rules) its own Object only Upload Picture (on Puzzle Rules) 5
pieceCountChosen Choose Piece Count (on Count Button) everyone who listens Arrange Board (on Puzzle Rules); Keyboard Focus (on Puzzle Rules); Show Count Underline (on Count Underline) 5
slideEnded Slide Piece (on Piece) everyone who listens Show Whole Picture (on Whole Picture) 5
slideStarted Slide Pieces (a Function, called by Make Player Exchange, Compare Next Pair) everyone who listens Slide Piece (on Piece) 5
sortEnded Computer Sort (on Puzzle Rules) its own Object only Sort Timer (on Puzzle Rules) 5
sortRequested Request Sort (a Function, called by Puzzle Commands, Button Action) the Puzzle Rules Object only Sort Timer (on Puzzle Rules) 5
speedChosen Choose Speed (on Speed Button) everyone who listens Sort Timer (on Puzzle Rules); Show Speed Underline (on Speed Underline) 5
uploadFailed Upload Picture (on Puzzle Rules) its own Object only Upload Picture (on Puzzle Rules) 5
uploadRequested Request Upload (a Function, called by Button Action) the Puzzle Rules Object only Upload Picture (on Puzzle Rules) 5
whoPlaysChanged Let Player Play (a Function, called by Choose Slot, Who Plays); Let Computer Play (a Function, called by Sort Timer, Who Plays) everyone who listens Show Outline (on Piece Outline) 5

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, and a Function sends “when called”.

B.3 Chapter 1: The Picture and the Board

B.3.1 boardArranged

  • Sent by Arrange Board (on Puzzle Rules), in “on resetRequested”, to everyone who listens.
  • Sent by Arrange Board (on Puzzle Rules), in “on shuffleRequested”, to everyone who listens.
  • Heard by Pieces Home (on Puzzle Rules): “on boardArranged”.
  • Heard by Show Piece (on Piece): “on boardArranged”.
  • Heard by Lay Out Slot (on Piece Outline, Piece): “on boardArranged”.
  • Heard by Player Exchange (on Puzzle Rules): “on boardArranged”.
  • Heard by Computer Sort (on Puzzle Rules): “on boardArranged”.
  • Heard by Sort Timer (on Puzzle Rules): “on boardArranged”.
  • Heard by Slide Piece (on Piece): “on boardArranged”.
  • Heard by Show Whole Picture (on Whole Picture): “on boardArranged”.

B.3.2 boardMade

  • Sent by Make Board (on Puzzle Rules), in “When the Game Starts”, to its own Object only.
  • Heard by Pieces Home (on Puzzle Rules): “on boardMade”.

B.3.3 placedOnBoard

  • Sent by Make Board (on Puzzle Rules), in “When the Scene Starts”, to the Object it just created.
  • Heard by Show Piece (on Piece): “on placedOnBoard”.
  • Heard by Lay Out Slot (on Piece Outline, Piece): “on placedOnBoard”.

B.3.4 resetRequested

  • Sent by Request Reset (a Function, called by Puzzle Commands, Button Action), in “when called”, to the Puzzle Rules Object only.
  • Heard by Arrange Board (on Puzzle Rules): “on resetRequested”.

B.3.5 shuffleRequested

  • Sent by Request Shuffle (a Function, called by Puzzle Commands, Button Action), in “when called”, to the Puzzle Rules Object only.
  • Sent by Make Board (on Puzzle Rules), in “When the Game Starts”, to its own Object only.
  • Sent by Arrange Board (on Puzzle Rules), in “on pieceCountChosen”, to its own Object only.
  • Sent by Arrange Board (on Puzzle Rules), in “on pictureChosen”, to its own Object only.
  • Heard by Arrange Board (on Puzzle Rules): “on shuffleRequested”.

B.4 Chapter 2: Your Hands on the Board

B.4.1 pieceChosen

  • Sent by Choose Slot (a Function, called by Keyboard Focus), in “when called”, to the Puzzle Rules Object only.
  • Sent by Piece Press (on Puzzle Rules), in “on pieceReleased”, to its own Object only.
  • Heard by Player Exchange (on Puzzle Rules): “Nothing Selected”.
  • Heard by Player Exchange (on Puzzle Rules): “One Selected”.

B.4.2 piecePressed

  • Sent by Piece Pointer (on Piece), in “When Left Is Clicked”, to the Puzzle Rules Object only.
  • Heard by Piece Press (on Puzzle Rules): “on piecePressed”.
  • Heard by Keyboard Focus (on Puzzle Rules): “on piecePressed”.
  • Heard by Who Plays (on Puzzle Rules): “on piecePressed”.

B.4.3 pieceReleased

  • Sent by Piece Pointer (on Piece), in “When Left Is Released”, to the Puzzle Rules Object only.
  • Heard by Piece Press (on Puzzle Rules): “on pieceReleased”.

B.4.4 piecesDropped

  • Sent by Piece Press (on Puzzle Rules), in “on pieceReleased”, to its own Object only.
  • Heard by Player Exchange (on Puzzle Rules): “on piecesDropped”.

B.4.5 piecesExchanged

  • Sent by Make Player Exchange (a Function, called by Player Exchange), in “when called”, to everyone who listens.
  • Heard by Pieces Home (on Puzzle Rules): “on piecesExchanged”.
  • Heard by Show Piece (on Piece): “on piecesExchanged”.
  • Heard by Computer Sort (on Puzzle Rules): “on piecesExchanged”.
  • Heard by Sort Timer (on Puzzle Rules): “on piecesExchanged”.

B.4.6 selectionCanceled

  • Sent by Puzzle Commands (on Puzzle Rules), in “When Cancel Is Pressed”, to its own Object only.
  • Sent by Input Interruptions (on Puzzle Rules), in “On Focus Lost”, to its own Object only.
  • Sent by Input Interruptions (on Puzzle Rules), in “On Touch Cancelled”, to its own Object only.
  • Sent by Lesson Panel Switch (on Puzzle Rules), in “on lessonRequested”, to its own Object only.
  • Heard by Player Exchange (on Puzzle Rules): “on selectionCanceled”.
  • Heard by Piece Press (on Puzzle Rules): “on selectionCanceled”.
  • Heard by Sort Timer (on Puzzle Rules): “on selectionCanceled”.

B.4.7 selectionChanged

  • Sent by Move Focus (a Function, called by Keyboard Focus), in “when called”, to everyone who listens.
  • Sent by Clear Selection (a Function, called by Player Exchange), in “when called”, to everyone who listens.
  • Sent by Player Exchange (on Puzzle Rules), in “Nothing Selected”, to everyone who listens.
  • Sent by Piece Press (on Puzzle Rules), in “on piecePressed”, to everyone who listens.
  • Sent by Piece Press (on Puzzle Rules), in “on pieceReleased”, to everyone who listens.
  • Sent by Piece Press (on Puzzle Rules), in “Release Seen”, to everyone who listens.
  • Sent by Piece Press (on Puzzle Rules), in “on selectionCanceled”, to everyone who listens.
  • Sent by Hide Focus (a Function, called by Keyboard Focus), in “when called”, to everyone who listens.
  • Heard by Show Outline (on Piece Outline): “on selectionChanged”.

B.5 Chapter 3: The Computer Compares

B.5.1 pairCompared

  • Sent by Compare Next Pair (a Function, called by Computer Sort), in “when called”, to everyone who listens.
  • Heard by Pieces Home (on Puzzle Rules): “on pairCompared”.
  • Heard by Show Piece (on Piece): “on pairCompared”.
  • Heard by Show Outline (on Piece Outline): “on pairCompared”.
  • Heard by Who Plays (on Puzzle Rules): “on pairCompared”.
  • Heard by Show Sort Lines (on Lesson State, Lesson Result): “on pairCompared”.
  • Heard by Lesson Lines (on Puzzle Rules): “on pairCompared”.

B.5.2 sortCleared

  • Sent by Clear Sort (a Function, called by Computer Sort), in “when called”, to everyone who listens.
  • Heard by Show Outline (on Piece Outline): “on sortCleared”.
  • Heard by Show Sort Lines (on Lesson State, Lesson Result): “on sortCleared”.

B.5.3 stepRequested

  • Sent by Request Step (a Function, called by Puzzle Commands, Button Action), in “when called”, to the Puzzle Rules Object only.
  • Sent by Sort Timer (on Puzzle Rules), in “On the Picture Sort Timer”, to its own Object only.
  • Heard by Computer Sort (on Puzzle Rules): “Fresh”.
  • Heard by Computer Sort (on Puzzle Rules): “Forward Pass”.
  • Heard by Computer Sort (on Puzzle Rules): “Backward Pass”.
  • Heard by Computer Sort (on Puzzle Rules): “Finished”.

B.6 Chapter 4: The Way Back

B.6.1 passFinished

  • Sent by Computer Sort (on Puzzle Rules), in “Forward Pass”, to everyone who listens.
  • Sent by Computer Sort (on Puzzle Rules), in “Backward Pass”, to everyone who listens.
  • Heard by Show Outline (on Piece Outline): “on passFinished”.

B.7 Chapter 5: The Finished Puzzle

B.7.1 backwardPassStarted

  • Sent by Computer Sort (on Puzzle Rules), in “Forward Pass”, to its own Object only.
  • Heard by Lesson Lines (on Puzzle Rules): “on backwardPassStarted”.

B.7.2 clearSelectionRequested

  • Sent by Let Computer Play (a Function, called by Sort Timer, Who Plays), in “when called”, to the Puzzle Rules Object only.
  • Heard by Player Exchange (on Puzzle Rules): “on clearSelectionRequested”.

B.7.3 forwardPassStarted

  • Sent by Computer Sort (on Puzzle Rules), in “Fresh”, to its own Object only.
  • Sent by Computer Sort (on Puzzle Rules), in “Backward Pass”, to its own Object only.
  • Heard by Lesson Lines (on Puzzle Rules): “on forwardPassStarted”.

B.7.4 lessonCloseRequested

  • Sent by Close Lesson (on Close Button), in “On Hud Activated”, to the Puzzle Rules Object only.
  • Sent by Upload Picture (on Puzzle Rules), in “on pictureUploaded”, to its own Object only.
  • Heard by Lesson Panel Switch (on Puzzle Rules): “on lessonCloseRequested”.

B.7.5 lessonRequested

  • Sent by Request Lesson (a Function, called by Puzzle Commands, Button Action), in “when called”, to the Puzzle Rules Object only.
  • Heard by Lesson Panel Switch (on Puzzle Rules): “on lessonRequested”.

B.7.6 lessonToggled

  • Sent by Close Lesson Panel (a Function, called by Lesson Panel Switch), in “when called”, to everyone who listens.
  • Sent by Lesson Panel Switch (on Puzzle Rules), in “on lessonRequested”, to everyone who listens.
  • Heard by Show With Lesson Panel (on Lesson Panel, Lesson Title, Lesson Line, Close Button): “on lessonToggled”.
  • Heard by Show Sort Lines (on Lesson State, Lesson Result): “on lessonToggled”.

B.7.7 pauseRequested

  • Sent by Request Step (a Function, called by Puzzle Commands, Button Action), in “when called”, to the Puzzle Rules Object only.
  • Sent by Let Player Play (a Function, called by Choose Slot, Who Plays), in “when called”, to the Puzzle Rules Object only.
  • Heard by Sort Timer (on Puzzle Rules): “on pauseRequested”.

B.7.8 pictureChosen

  • Sent by Use Picture (a Function, called by Choose Picture, Upload Picture), in “when called”, to everyone who listens.
  • Heard by Arrange Board (on Puzzle Rules): “on pictureChosen”.
  • Heard by Show Picture (on Picture Preview, Whole Picture): “on pictureChosen”.

B.7.9 pictureUploaded

  • Sent by Upload Picture (on Puzzle Rules), from the Run Code in “on uploadRequested”, to its own Object only.
  • Heard by Upload Picture (on Puzzle Rules): “on pictureUploaded”.

B.7.10 pieceCountChosen

  • Sent by Choose Piece Count (on Count Button), in “On Hud Activated”, to everyone who listens.
  • Heard by Arrange Board (on Puzzle Rules): “on pieceCountChosen”.
  • Heard by Keyboard Focus (on Puzzle Rules): “on pieceCountChosen”.
  • Heard by Show Count Underline (on Count Underline): “on pieceCountChosen”.

B.7.11 slideEnded

  • Sent by Slide Piece (on Piece), in “Sliding”, to everyone who listens.
  • Heard by Show Whole Picture (on Whole Picture): “on slideEnded”.

B.7.12 slideStarted

  • Sent by Slide Pieces (a Function, called by Make Player Exchange, Compare Next Pair), in “when called”, to everyone who listens.
  • Heard by Slide Piece (on Piece): “on slideStarted”.

B.7.13 sortEnded

  • Sent by Computer Sort (on Puzzle Rules), in “Fresh”, to its own Object only.
  • Sent by Computer Sort (on Puzzle Rules), in “Forward Pass”, to its own Object only.
  • Sent by Computer Sort (on Puzzle Rules), in “Backward Pass”, to its own Object only.
  • Sent by Computer Sort (on Puzzle Rules), in “On Variable Changed · Pieces Home”, to its own Object only.
  • Heard by Sort Timer (on Puzzle Rules): “on sortEnded”.

B.7.14 sortRequested

  • Sent by Request Sort (a Function, called by Puzzle Commands, Button Action), in “when called”, to the Puzzle Rules Object only.
  • Heard by Sort Timer (on Puzzle Rules): “Stopped”.
  • Heard by Sort Timer (on Puzzle Rules): “Running”.

B.7.15 speedChosen

  • Sent by Choose Speed (on Speed Button), in “On Hud Activated”, to everyone who listens.
  • Heard by Sort Timer (on Puzzle Rules): “Stopped”.
  • Heard by Sort Timer (on Puzzle Rules): “Running”.
  • Heard by Show Speed Underline (on Speed Underline): “on speedChosen”.

B.7.16 uploadFailed

  • Sent by Upload Picture (on Puzzle Rules), from the Run Code in “on uploadRequested”, to its own Object only.
  • Heard by Upload Picture (on Puzzle Rules): “on uploadFailed”.

B.7.17 uploadRequested

  • Sent by Request Upload (a Function, called by Button Action), in “when called”, to the Puzzle Rules Object only.
  • Heard by Upload Picture (on Puzzle Rules): “on uploadRequested”.

B.7.18 whoPlaysChanged

  • Sent by Let Player Play (a Function, called by Choose Slot, Who Plays), in “when called”, to everyone who listens.
  • Sent by Let Computer Play (a Function, called by Sort Timer, Who Plays), in “when called”, to everyone who listens.
  • Heard by Show Outline (on Piece Outline): “on whoPlaysChanged”.

B.8 Game State Changes (Sent by the Engine)

Set Game State makes the engine send Game State Changed to everyone who listens.

  • Picture Complete sets Solved in “On Variable Changed · Pieces Home”.
  • Picture Complete sets Playing in “On Variable Changed · Pieces Home”.
  • Heard by: Show Whole Picture.