Build a GameCreating Pitch Shot

Making What a Card Shows

Every piece of Pitch Shot comes to you in two parts. The first is a story: a few paragraphs that put the piece in your head, what it does in the game and roughly how. The second is a card, the same piece written out exactly, with every name and every number. Read the story. Then look at the card with that picture in mind, and build.

This page is about the cards. Each passage shows how to make one kind of thing in Myth Engine, in the editor’s own words. You don’t need all of it today. Read the first passage, Before your first card, and then start Chapter 1. A paragraph that opens with a later chapter, such as From Chapter 3, can wait until then. Come back whenever a card shows something you haven’t made yet.

The editor will feel strange at first. That’s true for everyone. It passes, and somewhere in the first few chapters your hands start finding things before your eyes do.

Before Your First Card

Everything your game is made of lives in the Resources panel, down the left side of the editor. Objects, Logic, tables, pictures, sounds and Scenes are all there. To make something new, press Add at the bottom of that panel. The Add Resource window asks what kind. Double-click anything in the Resources, and it opens in a tab of its own, beside the others.

A card lists what you change. Nothing more. Whatever it leaves out stays the way the editor makes it.

A few blocks come from Advanced Mode. Chapter 1 needs one of them already: Tween, the Action that glides a value from one number to another, which is how the notes bob. Chapter 10 adds Control Tween. Choose Settings > Advanced Mode at the top of the editor, and the bar along the bottom says Advanced mode enabled. Only the editor changes. Your game stays exactly as it was.

To run your game, press Play, the triangle at the top of the editor, and the game opens in a window of its own. Close that window, and you’re back. Save as you go with Ctrl+S, at the end of every part at least.

The Set Up Card

Each chapter opens with a Set up card. It holds everything that isn’t an Object or its Logic: pictures, sounds, settings, keys, and where things stand in the Scene. Each block starts with a heading in capitals. Here is Chapter 1’s. That chapter goes down it with you, one block at a time.

Set upWhat this chapter adds
ART (sprites, from the starter kit)
Backdrop Sunny Meadow
Backdrop Seaside Beach
Backdrop Autumn Woods
Backdrop Red Rock Canyon
Backdrop Candy Hills
Backdrop Snowy Peaks
Backdrop Jungle Falls
Backdrop Pirate Cove
Backdrop Mushroom Grove
Backdrop Volcano Isle
Backdrop Cloud Kingdom
Backdrop Moonlit Castle
Slingshot Art
Wood Post Art
Wood Plank Art
Stone Cube Art
Stone Plank Art
Ice Cube Art
Singing Note Art
GLOBAL VARIABLES
$stageNumberstarts at 1
GAME SETTINGS > General > World Scale
Pixels per Meter100
GAME SETTINGS > Display > Window
TitlePitch Shot
X1440
Y810
GAME SETTINGS > Display > Reference Resolution
X1920
Y1080
GAME SETTINGS > Display > Rendering
Texture FilteringSmooth Textures
Anti AliasingMSAA (Hardware)
GAME SETTINGS > Physics > Runtime
Physics EngineMyth Rigid Body
Y-9.8
SCENEField (new)
Background Color#8FD3FF
GAME SETTINGS > General > Startup
Start SceneField · 2D
SCENE Field: PLACE THESE
ObjectXY
Backdrop9.65.4
Ground9.6-0.2
Game Rules010.8
Slingshot32.8

ART names the pictures the chapter is about to use. They’re in your project already, because the Starter Kit brought every one of them. So there’s nothing to make. The list only says which ones matter now: here, the twelve painted places, the slingshot, the blocks and the singing note.

GLOBAL VARIABLES are values the whole game shares, such as the number of the stage you’re playing. On a card a Global has a $ in front, as in $stage, which is how you tell it from a Logic’s own values. You make one from any Logic Component. Open it, and down the left side of its canvas sits a small card named Globals. Press the + on it and choose New Global…. The Add Global window asks for a Name, a Type and a Default, the value it starts at. Type the name without the $, and press Add. Everywhere else on the cards, it’s written with it, and you type it that way.

GAME SETTINGS lines say where each setting lives. Take GAME SETTINGS > Display > Window. Press Game Settings, the button at the top of the Resources panel. Choose Display, and find the Window group. The names under the heading are its fields, and you enter them in the card’s order, top to bottom. Where the order matters, the chapter says why.

A SCENE block marked (new) is a Scene the chapter makes. In Chapter 1, it’s the one Scene your new project already has, given the card’s name: Field. To reach a Scene’s own settings, open it. Pick Select, the arrow above the preview. Then click an empty spot, and the Scene’s Properties appear on the left. Click the Background Color swatch, type the card’s code into the HEX box, and press Enter. A second click on the swatch closes it.

From Chapter 8, make each new Scene with Add > Scene. Give it the card’s name, leave Dimension at 2D, and make it. Its Background Color works as Field’s did.

Start Scene comes after the Scene for a reason. It’s a list of your Scenes by name, and Field is on it only once the Scene has that name.

PLACE THESE says what goes in the Scene, and where. Open the Scene, and the Place Scene Content panel is on its left. Your Objects are near its bottom, under Predefined Objects. Drag one onto the Scene. Then type the card’s X and Y into its World Position, in meters.

A Placement’s Own Values

Some lines under a placement start with “with”, and each is a value only this placement has. Chapter 1’s placements have none. Select a placement in the Scene, and its Properties open on the left. That’s where those values go, from Chapter 2 on.

From Chapter 7, a line such as with Per Instance Variables > Star Number = 2 gives this one placement its own value. The win card shows three stars, all one Object. This line tells the second star that it’s number 2. In the placement’s Properties, find the Per Instance Variables section, and type the card’s value into the box of that name. Myth displays starNumber as Star Number here; the name gains spaces for reading.

In Later Chapters

From Chapter 2, SOUNDS names the sounds the chapter uses, which came with the Starter Kit like the pictures.

From Chapter 2, some placements stay put on the screen while the world moves behind them, such as the message near the top. Their X and Y go into Screen offset (px), counted in pixels from the point the placement’s Screen Anchor picks. Select its placement in Scene Explorer. Scroll down Properties to Transform; Screen Anchor sits above Screen offset (px). Choose its top-left dot. Then type the offsets. A line such as with Z-Index = 10010 is the placement’s Z-Index, under Rendering. A higher number is drawn in front.

From Chapter 2, COMMANDS and INPUT CONTEXTS are the game’s keys. They have a passage of their own, near the end of this page.

From Chapter 7, GAME SETTINGS > General > Game State lists the states the game can be in, such as Playing and Stage Won. Your project has Playing already. For each new one, press Add Game State under Available Game States. Type its Game State Name, and press the window’s own Add Game State button.

From Chapter 10, GAME SETTINGS > Display > Page Background (Outside the Game) is what a web page shows around your game. Its Image line says Choose Image…, then the file. The card gives the file’s name, and the chapter gives you the file.

An Object Card and Its Components

An Object is a thing in your game: a singing note, a wooden post, the message near the top. Make one with Add > Object. The Create Object window asks for the card’s name and an Object Type. The card tells you which type:

  • A card with a Collider is a 2D Object. It starts with a Transform and a Collider. An Object of another type can take a Collider later, from Physics in the Component Toolbox.
  • A card whose Transform says Presentation > Space Window / UI is a Screen UI Object. It lives on the screen, measured in pixels. Its Space and Render Layer are set already, and it comes with UI Interaction attached.
  • Every other card is an Empty Object. It starts with a Transform and nothing else, and you attach what the card lists.

Here is the Wood Post, from Chapter 1. Every tower in the game is built from posts like this one, with planks laid across them.

ObjectWood Post
Transform
Bounding Box > SizeX 0.24, Y 1.12
Physics > Allow RotationOn
Physics > Spin Drag0.35
Collider
Shape and Transform > SizeX 0.24, Y 1.12
Physics > Bounciness (0–1)0.04
Physics > Friction (Grip)0.75
Fixed (no editor field)On
Sprite
Scene Depth Draw Order30
SpriteWood Post Art
Transform > SizeX 0.24, Y 1.12

The card lists the Object’s components, with the fields to change under each one. A component gives an Object one ability. Sprite shows a picture. Collider gives it a body, with a shape that can touch other things. Transform is on every Object from the start, and it says where the Object is and how big.

In the Object editor, Attached Components is the list at the top right. The Component Toolbox sits under it, in closed groups. Open a group. Click a component to attach it. Sprite and Text / UI are under Rendering, and Data Structure is under Data. Select a component in Attached Components, and its Properties open on the left. The card’s lines are those Properties, in order.

A Sprite asks for its picture first. The Add Sprite Component window lists your pictures, so pick the card’s and press Add Sprite. Scene Depth Draw Order decides which Object is drawn over which, and the higher number wins. The Wood Post’s 30 keeps it in front of the meadow. Transform > Size is how big the picture is drawn: in meters for a thing in the world, in pixels for a thing on the screen.

The Transform’s Bounding Box is a box the Object keeps for its own size, apart from its picture. It doesn’t change the picture. Type the card’s numbers into its Size all the same, so your Object matches the game’s.

The Transform also holds how the Object moves, in its Physics section. A 2D Object starts as a Physics Object: pushes and bumps can move it. So the card names that switch only where it’s Off, as on the Ground, which never moves at all. Below it are Mass, how heavy it is, and Allow Rotation, a switch that lets a bump turn it, and Spin Drag, how fast a spin dies away. A line ending in On or Off is a switch, and every other line is a box for its number. A line the card doesn’t give stays as it starts: the Wood Post keeps a Mass of 1.

A Collider’s lines are in two sections of its own Properties. Shape and Transform holds its Size. Physics holds Bounciness and Friction, how lively and how grippy it is when it touches something.

One line has no box at all: Fixed (no editor field). Fixed holds a Physics Object perfectly still, so nothing can push it, until Logic lets it go. That’s how the towers stand, waiting, until the right note is found. Myth Engine keeps the setting. This version of the editor has no switch for it, though, so the card tells you it’s there. Chapter 4 starts from Chapter 3’s catch-up project, whose blocks already have Fixed. That lets the tower stand firm when the first shot hits.

From Chapter 2, words on the screen use Text / UI. Its Font is a list. Pick Nunito there, the font that came with the Starter Kit. Font Size is a box. Emphasis has a list of weights, and the game’s words use Extra Bold. Color is a swatch: click it, type the card’s code into the HEX box, and press Enter. Alignment is a row of three choices, and Center is the middle one. Rendering is a choice too. Pick the card’s, Vector.

A Text with braces in it shows a live value. It changes while the game runs. Type it into the Text field as the card spells it, braces and all. The message near the top shows {data("Messages", $message, "words")}. As $message changes, so do the words.

A Text / UI has a Transform of its own, the place of the words inside their Object. Leave its Positioning on Independent, and type the card’s X and Y into its Position. On a Screen UI Object, a picture behind the words has Z Index Within Object -1, so it sits one step behind them. It goes in the box below Scene Depth.

On a Screen UI Object, UI Interaction comes attached. A card that lists it as (as it is added) means: keep it, and leave its fields as they come. When a Screen UI Object’s card doesn’t list UI Interaction at all, remove it with the red trash button on its row in Attached Components.

A Data Structure on an Object card is a small form of values the Object carries, such as the singing note’s Note State. Every one in this game says From Logic, with a Logic Component’s name. That Logic keeps its values there, and it brings the Data Structure along when you attach it. So don’t add one from the toolbox. Attach the Logic, as the paragraphs below show, and the Data Structure comes with it, already set to the card’s. An Object can carry several, each in a block of its own on the card. The Object editor lists them under Data Structures.

From Chapter 5, the five blocks wear a Tag. A Tag is a word stuck on an Object, like a label on a jar, so other things can find every Object that wears it. The card gives it as Object Tags Block. Attach Tags from the Data group of the toolbox, like any other component. In its Properties, open the Tag to Add list. The first time, choose Create New Tag… and press the + beside the list, Add Selected Tag. The Create Tag window asks for the Tag. Type the card’s, and press OK. After that, Block is in the list for every Object. Pick it, and press the + again.

Logic comes last on an Object card. Switch the list at the top right of the preview from Components to Logic. The panels show Attached Logic above the Logic Toolbox, which holds what fits this Object. Click each Logic Component the card names.

The lines under Shared Variables come after the Logic, because the Logic brings them. In Chapter 1, Game Rules has one: singingNote, set to Singing Note. Switch the list back to Components. At the top of the Properties, under Variables, each value the Logic gives this Object has its own rows: its name, its Type, its Kind and its Value. A card line such as singingNote Singing Note is that Value. A number goes into its box. An Object is a button that reads None until you press it and pick the card’s. The card lists only the values this Object sets for itself. Every other one keeps the Starting Value its Logic gives it. Leave those.

A Data Structure Card

A Data Structure is a small form of named fields. A table can use one as the shape of every row, and an Object can carry one filled-in copy. Make one with Add > Data Structure. The Create Data Structure window asks only for its Name. A new one starts with no fields at all. Here is Note Spot, from Chapter 1. Each of the game’s singing notes is one Note Spot: the pitch it sings and the tower it sits in.

Data StructureNote Spot

One singing note of a stage: the pitch it sings and the tower it sits in.

pitchTextdefault (empty)
midiNumberdefault 0
towerNumberdefault 0

The sentence under its name is its Description. If you’d like it, type it into the Description box on the left, under the Name. The game never reads it, but months from now, you will.

Press Add Field for each line. A field has a Name, a Type and a Value, and the card’s default goes in Value. A new field comes as a Number with 0. Switched to Text, it keeps that 0, which a Text doesn’t want. So where the card says default (empty), as pitch does, clear the box.

A type that starts with Thing, such as Thing Object in Chapter 1 or Thing Sound in Chapter 2, holds a resource of your project by name. The Type list keeps those under Things, below the Values: pick Object or Sound there. Its Value starts at None, an empty reference, which is the card’s default.

A Logic Component Card

A Logic Component is a piece of behavior you attach to an Object: how a note bobs, how the stage is built. Make one with Add > Logic Component. The Create Logic Component window asks for a Name and a Starter. Leave the Starter on Empty Logic Component. This card is from Chapter 1. It makes a singing note bob gently while it waits.

Logic ComponentBob While WaitingAttach to: Singing Note

Moves this singing note gently up and down around where it was placed, each note starting at its own moment.

Attach toAny Object
DATA STRUCTURES
Note Stateself.noteState
SHARED VARIABLES
NameTypeKindStarting Value
bobMetersNumberConstant0.03
secondsPerSwingNumberConstant1.43
When Created
WhenCreate
1Change Component Value
Component Value
self.noteState.homeY
Value
self.transform.position.y
2Generate Random Number
Action Name
startOffset
Minimum
0
Maximum
1
3Start Recurring Timer
Timer Name
"bob"
Repeat Every (s)
@self.secondsPerSwing
First Delay (s)
startOffset.value * @self.secondsPerSwing
On the Bob Timer
WhenRecurring TimerTimer name: bob
1Tween
Value
self.transform.position.y
Target
self.noteState.homeY + @self.bobMeters * self.noteState.swingDirection
Duration
@self.secondsPerSwing
Ease
Quad in Out
2Change Component Value
Component Value
self.noteState.swingDirection
Value
-self.noteState.swingDirection

The top of the card names the Logic Component and the Object it attaches to in this game. The sentence under the name is its Description, yours to type or skip. The Attach to line under that is the Logic Component’s own setting. Leave it at Any Object.

A new Logic Component opens on a big, empty canvas, crossed by a grid. Down its left side sits a column of small cards: Logic Component, Globals, Data Structures, Components, Per Instance Variables and Shared Variables. Each has a + in its corner, and the card’s blocks of the same names are made with them. The first one folds open to show the Name, the Description and Attach to. Type the Description there, if you like.

DATA STRUCTURES name the Data Structure this Logic keeps on its Object. Bob While Waiting keeps where its note started and which way it swings next, in Note State. Make the Data Structure first, from its card. Then press the + on Data Structures, and pick it under Existing Data Structures. Myth gives it a name of its own, and the card’s row shows it: Note State self.noteState. The Logic reads every field through that name, as self.noteState.homeY.

SHARED VARIABLES are values this Logic keeps on each Object it’s attached to, and an Object can set its own, as Game Rules does. Press the + on Shared Variables. The Add Shared Variable window asks for a Name, a Kind, a Type and a Starting Value. Its Kind starts on Changeable. Pick the card’s, Constant on most of them. Then press Add. In the Logic, a Shared Variable reads with an @ in front: @self.secondsPerSwing. An Object one, such as Build The Stage’s singingNote, takes Object in the Type list, and its Starting Value stays None.

From Chapter 4, COMPONENTS name a component of the Object that this Logic changes, such as self.collider Collider. Press the + on Components, and pick Collider under Component types. The row then reads self.collider.

From Chapter 7, PER INSTANCE VARIABLES are values each placement of the Object sets for itself, such as which of the three stars on the win card this one is. The + on Per Instance Variables makes them, with a Name, a Type and a Starting Value. In the Logic, one reads as self.starNumber.

The rest of the card is its Events, each with its Actions. The next passages are about those.

Events: The When Bars

An Event is a moment your Logic waits for: the Scene starting, a note being made, a timer going off. Each Event on a card starts with a plain heading, such as When Created. That’s the name Myth gives the Event by itself, from its kind and its setting, so you never type it.

Under the heading is the When bar. It names the kind of Event. Then comes its setting, if it has one: a Timer name, a Command, a Global Variable, a Mouse button or an Object.

Press Add Event, the + in the canvas’s toolbar. Its window has a filter at the top, so type the kind’s name there, pick it, and press OK. Scene Start and Create ask nothing more.

The Event lands on the canvas as a big green block, with a smaller one beside it, joined by an arrow. That smaller block is the Event’s Mode, named Mode 1. Its Actions hang below it in one line, and the line ends at End. A card’s Event with one way of answering shows no Mode at all. Leave Mode 1 as it is.

A Recurring Timer has a name you make up, so its second window can’t list it. Choose Type a timer name… and press OK. Then type the card’s name into the small window that comes next. Bob While Waiting’s timer is bob. On the Start Recurring Timer that starts one, Ring Once set to Yes means it rings one time and stops. With its First Delay empty, that ring comes after Repeat Every.

A Logic Component can have several Events, and they all sit on the one canvas, each with its own line. The buttons at the bottom of the canvas zoom it, and Fit shows the whole of it at once.

For Chapter 1, the paragraphs above are all you need. The rest can wait.

From Chapter 2, Command Pressed asks for its Command in a second window, and Variable Changed for its Global Variable. Pick the card’s, and press OK again. UI Activated asks nothing more.

From Chapter 2, many Events are a Custom Event: a message one piece of Logic sends and others listen for, like a bell rung in one room and heard in another. Its When bar names the message, such as callRequested. To listen for a new one, open the Add Event window and choose Custom Events > Project Events > Add Custom Event…. Type its name. Once some Logic sends that message or listens for it, it’s on the list already.

You can build the sending and the listening in either order. Trigger Custom Event rings the bell for every Object that listens. Trigger Custom Event on Object rings it for one Object only, the one its Applies To names. Either one’s Custom Event field takes the name exactly as you type it.

From Chapter 3, the pull comes in. Mouse Press, Mouse Held and Mouse Release each ask for a Mouse button in a second window: left, right or middle. Pick the card’s, left. 2D Axis Input asks for its Command, Aim. Step, Focus Lost and Touch Cancelled ask nothing more. Those last two are quiet. They catch a pull cut short by another window or by the device, so nothing is left hanging.

From Chapter 5, Collision Enter asks nothing in a second window. Its Object is a list on the Event’s block, in its Collision section, which starts closed. Click its heading to open it. The list is Collision Target, and it starts at Any Object. Pick the card’s there. From Chapter 6, it may be a Tag, as Object: tag:Block. Pick Tagged Block, under Tags at the very end of the list, after all your Objects. The Event’s block also lists other, the Object this one touched. A card’s other means that one.

From Chapter 8, Mouse Pressed on Object asks for its Mouse button too. From Chapter 9, 2D Direction Pressed asks for its Command in a second window. Its Direction is four buttons on the Event’s bar. Press the card’s. Game Start, from Chapter 10, asks nothing more.

Modes

From Chapter 3, some Events answer in more than one way. Each way is a Mode, with its own name and its own line of Actions. The aiming dots are one example. Every Step, they either stay hidden or follow the pull. On a card, each way is a line under the When bar, such as Mode Hidden (Starting Mode). A card shows such an Event once for each of its Modes, each time with the same heading and When bar. Two headings alike are one Event with two Modes.

Name the first Mode: right-click Mode 1 and choose Rename Mode…. Type the card’s name. For each of the others, right-click the Event’s block and choose New Mode…, and type its Mode Name. Each new Mode gets its own block, to the right of the last, with its own line. Its Actions go there. A Mode marked (no Actions) stays empty. While it’s the one that answers, the Event does nothing at all.

An Event with several Modes shows Modes on its block, with two choices. Every Event in Pitch Shot stays on One at a Time, as it starts, so one Mode answers at a time. The card marks the one it starts with, (Starting Mode), and you pick that one in the block’s Starting Mode list.

Switch Mode changes which Mode answers, while the game runs. Its block picks an Event and a Mode from two lists. The Event list starts on Current Event. Pick the Event the card names, by its heading, even when it’s the Event the block is in. Then the Mode list holds that Event’s Modes. So make the Event and its Modes before the Switch Mode that picks them.

Actions, One at a Time

Under each Event, the numbered rows are its Actions, in order. In the editor, they’re blocks on the canvas, the big space in the middle, and arrows join them into one line that runs down from the Mode to End. The Action List on the right holds every Action, in closed groups. Type an Action’s name into the search box at its top. Click it, and its block appears.

A new block lands a little to one side, apart from the line, with no arrow into it. A block like that does nothing. Not yet. Right-click it and choose Connect to Sequence. It joins the end of the line, right above End. Build down the card, and join each Action as you add it.

When an Event has several Modes, each Mode has a line of its own. To add an Action to one of them, right-click that Mode’s block, or a block on its line, and choose Add Unattached Action Here. A window opens with the Actions in it. Pick one and press OK. Its block lands near that line, and Connect to sequence joins it there.

Fill in the fields the card lists. Leave the rest the way they start. An Action with no lines under it is whole: add it, join it, and leave it alone.

Some Actions have an Applies To line, naming the Object they work on. Without one, they work on this Object. On the block, Applies To is a list, and it starts on Self.

A Change Variable reads Set on its block: its Variable, an =, and its Value. The Value replaces what the Variable held. A card’s Change Variable may have an Operator line. Click the = slot. Pick the card’s operator from the list. With +=, the Value is added on, and with -=, it’s taken away. For floorBottom in Build The Stage, pick += and type @self.floorHeight into Value. No Operator line on the card? Leave =, and type the Value as it is.

From Chapter 1, an Event or a Function can make a value of its own for one run, with Declare Variable. Its block has a Type list, a Name and a Value. The Type starts at Number. The card names another only where it differs. After that, the card names the value plainly, as floorNumber, and you type that name into a Change Variable’s Variable box. Leave the box. It reads self.floorNumber now, and that’s the same value, the one Declare Variable made. When the Actions finish, it’s gone, and the next run makes it again.

Some Actions hand back an answer. On the card their first line is an Action Name. On the block it’s the box after the word as, and it holds a name of Myth’s to start. Type the card’s name there, with no quotes. A later Action reads the answer by that name, a dot, and the part it wants. Take Bob While Waiting. A Generate Random Number there is named startOffset, and startOffset.value is the number it picked.

A Function goes in like any Action, from the Functions group of the Action List. The card marks it with a small Function tag. Its fields are the Function’s Parameters, each one a box or a list under its own name. One that takes an Object is a list. It holds the Logic’s own Object Variables, or in a Function its Object Parameters, such as builder. Pick the card’s there.

Create Instance makes a new Object while the game runs, and Build The Stage makes every singing note this way. Pick which Object in its Object to Create list. In a Logic Component, it’s one of the Logic’s own Object Variables, as @self.singingNote. In a Function, it’s one of the Function’s Object Parameters. The new Object needs a name for the Actions after it. That’s its Variable Name box: type the card’s name over the one it starts with, such as newNote.

Change Component Value changes one field of a component or a Data Structure, the one its Component Value path names. Type the path as the card spells it. The path self.noteState.homeY is the homeY field of the Note State the singing note carries. Its Operator works like Change Variable’s: click = and pick the card’s operator.

From Chapter 2, a new step sometimes goes between two old ones. To put a block between two others, click the round handle at the bottom of the block it should follow. Then click the round handle at the top of the new block. To put it first, start from the Mode’s block, which has a bottom handle too. The handles also move a block that’s already joined, while Connect to sequence only adds to the end. They join blocks of one panel only. So between two blocks inside an If’s or a Repeat’s panel, add the new block with that block’s own Add inside item first.

Values, Quote Marks and All

Every value on a card is written the way its box should hold it. In a formula, a plain name, such as floorNumber, is a value this Logic declared for itself, or a Function’s Parameter. A $ in front marks a Global, as in $stage, and an @ a Shared Variable, as in @self.secondsPerSwing. A Data Structure’s field reads through its Object, as self.noteState.homeY. A value can be a small formula too. data("Notes", noteRow, "midi") reads one cell of the Notes table: the row noteRow, in the column midi. The row can be a number, counted from 0, or a row’s name from the table’s Entry column, such as wood.

Many boxes read what you type as a formula. In those, text needs quote marks, such as "cut" in Set Data Cell’s Column. Without them, the box looks for a value with that name.

A resource list works differently. You pick a name. Pick Places in Check Data Row Exists’s Table list, or Sound Stretch in Control Sound’s Sound list. A formula can go there too: choose From a Value, then type the card’s formula.

A Timer Name holds the name itself. It isn’t a formula. Type bob, without quotes, though the card and the finished slot may show "bob". A Custom Event’s name goes in bare too, as callRequested.

Single and double quote marks do the same job. Type whichever the card shows. Both give you text.

A true or false goes into a box as that word. A Yes or No is a list that holds the two, as on a Boolean field’s Value in a Data Structure. The card shows which.

From Chapter 3, eventValue("position.x", 0) reads something the Event brought with it, here the x of the pointer that was pressed. The 0 is what it gives when there’s nothing to read.

If, Else, Repeat and Region

An If runs some Actions only when its condition is true. It’s in the Action List’s Logic group. On the canvas it’s a wide, pointed block, and a line marked True runs down from it. That line holds the Actions the card indents under the If, in the part the card marks Then.

Its condition is the one box on the If. The card gives it after the word If. Click the box, type it whole as the card spells it, such as placeFound.value == true, and press Enter. A red edge means a name in it isn’t one this Logic knows. Check the spelling against the card. A condition can join two tests. && means and: both have to be true. || means or: one is enough. Type them into the same box.

To put a block on the True line, right-click the If and choose Add inside Then. A window opens with the Actions in it, and a filter at the top, your Functions among them. Pick the Action and press OK. It lands under the If, but not joined yet. Right-click it and choose Connect to sequence, as on the main line. It joins the end of the True line. With one If inside another, right-click the If whose line the card’s step is on.

The step numbers count right through. So step 5 may sit inside an If that began at step 4, and the bars at the left of the card show where each one belongs. A card may go on after an If, with a step that has no indent. That step is on the main line, below the If. Add it from the Action List, as usual, and join it with Connect to sequence.

A Repeat runs its Actions a set number of times. That number is its Count, and its box is on the Repeat block itself. Build The Stage’s first Repeat runs once per tower. Inside a Repeat, local.index says which time round it is, counting from 0. On the card, its steps sit under Each time, as an If’s sit under Then. Right-click the Repeat and choose Add inside Repeat for each one, and join each one the same way. A Repeat can sit inside another. Build The Stage builds each tower floor by floor that way.

A Region isn’t an Action at all. It’s a colored frame with a name, drawn around steps that belong together, and it changes nothing in how they run. Build The Stage has two: Towers and Singing Notes. On the card a Region looks like a step, with the steps it holds under it. You won’t find it in the Action List, though. Build its steps first. Each Region in Pitch Shot holds one Repeat, with everything inside it. Click that Repeat, and press Region from Selection in the row of buttons above the canvas. A green frame appears around it. Type the card’s Label into the frame’s name box, without the quote marks: Towers. Then click the frame’s swatch, and type the card’s Color into the HEX box.

For Chapter 1, that’s all you need. The rest can wait.

From Chapter 2, the card’s Else is the If’s Else, the Actions for false. Right-click the If and choose Add Else. The Else appears beside the If, on a line marked False. Right-click the Else and choose Add inside Else for each of its Actions, and join each one with Connect to sequence. Else gets a step number on the card, marked Otherwise, but you won’t find it in the Action List.

A Function Card

A Function is a small piece of Logic with one job. Where A Note Sits, from Chapter 1, answers where a singing note belongs in its tower. Make one with Add > Function. The Create Function window asks only for its Name.

FunctionWhere A Note Sits

Works out where a singing note of the stage being played sits, from its pitch: a higher note sits higher. noteRow is its row of the Notes table; x and y are the middle of the note (meters).

PARAMETERS
NameTypeStarts at
noteRowNumber0
groundHeightNumber1.3
floorHeightNumber1.34
noteAboveFloorNumber0.56
RETURN TYPEWhere A Note Sits Result (a Data Structure)
ACTIONS
1Declare Variable
Name
pitch
Value
0
2Declare Variable
Name
lowestPitch
Value
0
3Declare Variable
Name
semitonesPerFloor
Value
1
4Declare Variable
Name
floorNumber
Value
0
5Declare Variable
Name
tower
Value
0
6Declare Variable
Name
towerRow
Value
0
7Declare Variable
Name
noteX
Value
0
8Declare Variable
Name
noteY
Value
0
9Change Variable
Variable
pitch
Value
data("Notes", noteRow, "midi")
10Change Variable
Variable
lowestPitch
Value
data("Notes", data("Stages", $stage - 1, "firstNote"), "midi")
11Change Variable
Variable
semitonesPerFloor
Value
data("Stages", $stage - 1, "semitonesPerFloor")
12Change Variable
Variable
floorNumber
Value
round((pitch - lowestPitch) / semitonesPerFloor)
13Change Variable
Variable
tower
Value
data("Notes", noteRow, "tower")
14Change Variable
Variable
towerRow
Value
data("Stages", $stage - 1, "firstTower") + tower
15Change Variable
Variable
noteX
Value
data("Tower Plans", towerRow, "x")
16Change Variable
Variable
noteY
Value
groundHeight + floorNumber * floorHeight + noteAboveFloor
17Return
x
noteX
y
noteY

Its card has PARAMETERS, then a RETURN TYPE, then ACTIONS. There’s no Event. Its Actions hang in one line on the canvas, from Start to End, and they run each time another piece of Logic calls it. The first Action you add joins right after Start, with Connect to sequence. Its Description, if you’d like it, goes in the Function’s settings. Press Logic Settings, the gear in the row of buttons above the canvas, and they open in the small Function card at the canvas’s top left.

PARAMETERS are the values the Function is handed. Make them on its Start block, under Parameters, with the + there. The Add Parameter window asks for a Name, a Type and a Default, the card’s Starts at. A Parameter that is handed an Object, such as Place A Block’s builder in Chapter 1, takes the Object at the very end of the Type list. There’s an Object higher up the list too, among the plain values. That one holds an Object’s name, the way a Number holds a number, and Place A Block’s kind is one of those: a Thing Object, which starts at Wood Post.

From Chapter 3, an Object Parameter may list Required Components, as Aim At’s happyNote does. They say what the Object must carry. Here it’s a Data Structure. Each Parameter on the Start block has a pencil beside its name. Press happyNote’s, and the Edit happyNote window opens, with its Compatibility Mode and its Required Components. Press Add Required Component. Pick Data Structure as its Component Type. A Required Schema list appears, so choose the card’s, Shot Sums. Type the card’s Slot Name last, shotSums, because picking a type puts back a name of its own. Changes hold as you make them. Press Done.

A Function hands back its answer with a Return, its last Action. The answer’s shape is a Data Structure, named on the RETURN TYPE line: Where A Note Sits Result, with the fields x and y. Make that Data Structure first, from its card. Then open Logic Settings again, and pick it in the Return Type list. The Return block then has a box for each field. Type the card’s value into each, as x noteX. Build The Stage calls the Function with the Action Name noteSpot, and then reads noteSpot.x.

A Data Table Card

A Data Table is a spreadsheet the game reads while it plays, one row for each thing. Make one with Add > Data Table. The Create Data Table window asks only for its Name. Here is Block Kinds, from Chapter 1: how wide and how tall each kind of block is.

Data TableBlock KindsData Structure: Block Kind
Row 0Wood Post
width0.24
height1.12
Row 1Wood Plank
width2.36
height0.22
Row 2Stone Cube
width0.56
height0.56
Row 3Stone Plank
width2.36
height0.22
Row 4Ice Cube
width0.56
height0.56

Block Kinds names Block Kind in its head. That’s its shape. A new table makes a Data Structure of its own, named after it with Entry on the end. This game’s tables use the ones you made instead. Open the table’s Entry Type list, which holds your Data Structures, and pick Block Kind. The table’s columns become its fields. So make the Data Structure before its table.

Then the rows. Add Row sits under the grid. A row’s name goes in the grid’s Entry column. Double-click a cell to type in it, and Enter keeps what you typed. The card counts rows from Row 0. The editor numbers them from 1. So the card’s Row 0, Wood Post, is the first row on your screen.

Some tables are long. Notes has 470 rows, one for every singing note of every stage, and you won’t type them. Its card gives the table as a file under IMPORT CSV, with the address to download it from. Make the table and pick its Entry Type first, so its columns are there. Then press Import CSV, beside Add Row, and pick the file. Myth Engine asks first, and you press Import CSV again. An import matches rows by Entry name: matching rows are updated, and new names add rows. Existing rows absent from the file stay unchanged. The card’s FIRST ROWS show how the table begins, so you can check yours.

A Particle Effect Card

From Chapter 4, the game throws tiny pictures into the air: a puff of dust where the happy note comes to rest, splinters from a falling post. Each spray is a particle effect. Make one with Add > Particle. The Create Particle window asks for a Name and a Starter. Leave the Starter on Blank Particle. A particle card lists only what differs from a blank one.

Particle EffectLanding Dust
Emitter
Emission > Burst Count10
Emitter Shape > Emit Radius (m)0.288
Motion
Lifecycle > Each Particle Lives (ms)min 400, max 700
Motion > Speed (m/s)min 0.4, max 1.3
Motion > Angle (Deg)min 10, max 170
Forces > Gravityx 0, y 0.1
Appearance
Appearance > Particle SpriteSmoke Puff
Appearance > Color#CDBB99
Appearance > BlendNormal
Appearance Over Life > Scalestart 2.24, end 5.12
Appearance Over Life > Alphastart 0.6, end 0

Its Properties come in three pages, Emitter, Appearance and Motion, and you pick one in the list at the top right of the preview. The card uses them too, in its own order: Motion comes before Appearance there, so look for each line’s page by its name.

Each line names a section, then a field. Lifecycle > Each Particle Lives (ms) is that field in the Lifecycle section. Open the section if it’s closed. A min and a max go in the two boxes of a range, and a start and an end go beside their small captions. Motion > Angle (Deg) is a dial, and its min and max go into the boxes under it. Appearance > Particle Sprite is a list of Myth’s own particle pictures. Landing Dust’s is Smoke Puff. Forces > Gravity is a pair of boxes, captioned x and y. Appearance > Color is a swatch, as on Text / UI: click it and type the card’s code into the HEX box. Appearance > Blend is a list.

Burst Count is how many particles burst at once. An Action asks for the burst. When the Burst Particles Action gives a Count of its own, the Action’s Count wins.

Keys: Commands and Input Contexts

From Chapter 2, the game listens to the keyboard. COMMANDS on the Set up card are its keys, each under a name your Logic uses. Your Logic asks whether Hear It Again was pressed, and never cares that it was Space.

Open Game Settings and choose Input Manager. On its left are the Input Contexts. Each one is a set of Commands that work together, and your project has one, Default. Beside them is the Command Set. It shows the Commands of the context whose row is selected.

Press Add Command. A small window asks for the Command Name and the Input Type: Button or 2D Axis, in this game. Its own Add Command button makes it. A new Button Command has one row that reads No Input Assigned. Click it, and press the card’s key. Add Keybinding adds a row for a second key. From Chapter 3, a 2D Axis Command comes with a row for each direction, and each one takes its key the same way.

INPUT CONTEXTS says which Commands belong to which context. In Chapter 2, the line Field (rename Default) means: give Default the name Field. The pencil button beside its name, Edit, opens a window with the Input Context Name. Type the card’s, and press Save Input Context. Default is Active at Start already. From Chapter 3, a line marked (changed) is a context you have already, with the same switches. Only its Commands are new. Select its row before you add them.

From Chapter 8, a Command can belong to more than one context. Make it once. Pick it from Reuse a Command…, below Add Command. Use Add Keybinding to give it the keys listed for this context, even if another context uses the same keys. The Command name is shared; each context keeps its own bindings.

From Chapter 7, a line marked (new) is a context of its own. Press Add Input Context, and type its Input Context Name in the window that opens. The new context starts Inactive at Start, and its row is selected, so the Commands you add next go into its Command Set. While the game runs, the Action Set Input Context Active turns a context on or off. That’s how Enter goes on to the next stage only while the win card is up.

Changes Cards

From Chapter 2 on, the game changes what you’ve already made. A Changes card shows the whole piece with the changes marked, so you can find your place. Lines marked Add, in green, are new: add them. Lines marked Delete, red and struck through, are gone: delete them. To take a block off the canvas, right-click it and choose Delete. Everything else is there already, unless the chapter asks you to rebuild a branch around it. Red and green steps have their own old and new numbering. A step number can appear twice.

Sometimes a step stays and only its values change. Then the new values are green, with the old ones struck beside them. This one, from Chapter 2, gives the Singing Note a second Logic Component, so it can sing.

ObjectSinging NoteAddDelete
Transform
Bounding Box > SizeX 0.84, Y 0.83
Sprite
Scene Depth Draw Order35
SpriteSinging Note Art
Transform > SizeX 0.84, Y 0.83
Data Structure
From LogicBob While Waiting, Sing In The Opening
From LogicBob While Waiting
Data StructureNote State
Logic
Bob While Waiting
Sing In The Opening

One kind of line changes by itself. A From Logic line under a Data Structure names the Logic that brought it. When you attach one more Logic that needs the same Data Structure, its name joins the line on its own. So when a Changes card strikes out an old From Logic line and adds a longer one, there’s nothing to delete. Attach the Logic, and the line is right.

A table’s IMPORT CSV lines show on its Changes card too, as a reminder of where it came from. Import again only when the chapter says to.

If Your Game and a Card Disagree

It will happen. A value lands in the wrong box, or a step goes in the wrong place. That’s how everyone learns this.

A piece that does nothing at all? Look first for a block with no arrow into it, and join it with Connect to sequence. A box with a red edge? Count its quote marks, and look for a missing one. A note that never sings? Perhaps its message is spelled two ways, once where it’s sent and once where it’s heard.

Every chapter’s Goal holds that chapter’s finished project as a download. It’s a zip. Right-click it, choose Extract All…, and then Extract. Open the project inside with File > Open Project…. If yours has changes you haven’t saved, Myth offers to save them first.

Find the piece that misbehaves. Go down it line by line against yours, until the two part ways. Or start the next chapter from the download. It already holds the whole Starter Kit. Nothing you built is wasted, because now you know where everything goes.

Chapter 1 begins with a new, empty project. It ends in a sunny meadow, with two golden notes bobbing in a wooden tower, waiting for a voice.