- Learn
- Build a Game
- Sky Ace
- 10 Title and Menus
Sky Ace gets its front door. The SKY ACE logo over the same ocean, your Fighter bobbing under it, and PRESS ENTER TO TAKE OFF blinking. A Main Menu with START MISSION, HOW TO PLAY and QUIT GAME. A PAUSED menu when you need a breath, and a high score that waits for you on the Title.
The game as it is at the end of this chapter. Click the game, then press Enter to start.
This chapter builds on Chapter 9’s game. Starting here? The catch-up download in Chapter 9’s Goal is that game, finished, ready to start from.
If your game and this chapter part ways, here is the chapter’s finished project. Open it and compare.
To open it, right-click the downloaded file, choose Extract All... and then Extract. Start Myth Engine, choose File › Open Project... and pick the .mythproj file in the new folder. Beside it, OFL.txt is the license of the project’s font, Bebas Neue.
10.1 The Idea
The sea slides down the middle of the screen, as it always has. Islands drift past, and a cloud. Over them, gold letters on a red banner say SKY ACE. Under the banner, a silver Fighter bobs gently, side to side and up and down, as if it were waiting for you.
The Title Theme plays. At the bottom, PRESS ENTER TO TAKE OFF blinks.
Press Enter. The screen fades, and the Main Menu opens over the same sea. START MISSION glows red. Press Down, and HOW TO PLAY glows instead.
Right now, though, your game has no front door at all: run it, and you’re in the middle of a mission, with the planes already coming. This chapter builds what comes before, and what comes after: the Title, the Main Menu, a pause, and a way home.
These are new places. A Scene is one place your game can be, with its own camera, its own sea and its own Objects. You’ve had one Scene since Chapter 1, Gameplay. This chapter adds two more, the Title and the Main Menu, and Go to Scene moves between them.
Each place needs its own controls, too. Space fires in a mission. On the Title it should take off, and on the menu it should choose. So the Commands get sorted into sets, one set for each place. Each set is an Input Context.
Think of a phone’s keyboard. The same keys type letters or numbers, depending on which set is showing.
The Main Menu brings one more new idea. Its three buttons are one Object, placed three times. What makes START MISSION start a mission, and QUIT GAME end the game? Each placement keeps its own number, its choice: 0, 1 or 2. Press Enter, and the chosen button calls one Function, Do What Was Chosen. It looks at the choice. Then it does that button’s job.
There’s a lot to place in this chapter, more than ever before. Much of it is pieces you know: words on the screen, a picture, a blink. Take it part by part.
At the end, your game is whole. In Chapter 1 your Fighter flew alone over an empty ocean. Now it has a front door.
10.2 The Plan
Here’s how the pieces work together. Read each line from left to right: it starts with something that happens in the game.
Most of these names are new to you. Read it once for its shape, and come back to it as each piece is built. It’s a map, not a test.
- The game starts -> the Title opens, with only the Title controls on -> Title Music loops the Title Theme, and High Score reads the high score.
- Enter on the Title -> Take Off calls Go to the Main Menu -> Go to Scene fades to the Main Menu.
- The Main Menu opens -> Use Menu Controls switches the Menus controls on -> Main Menu Keys sets
$menuChoiceto 0, and Lit When Chosen lights START MISSION. - Down -> Main Menu Keys changes
$menuChoice-> Lit When Chosen lights the next button. - Enter -> Main Menu Keys sends menuConfirmed -> the chosen button’s Menu Choice calls Do What Was Chosen.
- HOW TO PLAY -> Open How to Play sends howToPlayOpened -> Show With How to Play shows the panel, and the keys and buttons switch to Reading How to Play.
- START MISSION -> Start the Mission fades to Gameplay -> Use Flight Controls switches the Flight controls on, and Mission Music stops the Title Theme.
- Esc in a mission -> Pause sends showPauseOverlay -> Pause Overlay Lifecycle pauses the game and shows PAUSED.
- The mission is won -> Mission Over switches Return to Base on -> Enter calls Back to the Main Menu.
10.3 Set Up
This chapter uses nineteen more pictures and two more sounds. They’re in your project already.
The Set up card is the longest in the book. Each block goes with a part of this chapter, so don’t make it all now. COMMANDS and INPUT CONTEXTS come first, in the next part. GLOBAL VARIABLES and the two new Scenes come with the Title and the Main Menu. The How to Play placements have a part of their own, and the two Gameplay placements come in the last part.
Escape, BackspaceEscape, PConfirmFly, Confirm, BackFly, Fire, Bomb, Pause, Confirm#0B3A5ETitle · 2D#0B3A5E10.4 Three Sets of Controls
First, the controls. Right now every Command works everywhere. Once there’s a Title and a Main Menu, one key has different jobs in different places. Space takes off on the Title and fires in a mission, and Esc goes back on the menu but pauses a fight.
So the Commands go into three Input Contexts. Title holds only Confirm. Menus holds Fly, Confirm and Back. Flight holds Fly, Fire, Bomb, Pause and Confirm. Only one is on at a time, and each Scene switches on its own.
10.4.1 The Input Contexts
Open the Game Settings, and choose Input Manager. On the left is the Input Contexts list. Your project has one, named Default, and every Command you’ve made is in it.
Rename it first. Press the pencil button on its row, and the Edit Input Context window opens. Type Title, and press Save Input Context. Its switch says Active at Start. That’s the card’s Active at Start: this set is on when the game begins.
Next, press Add Input Context, under the list. Type Flight, and press Add Input Context in the window. Flight is selected now, and its switch says Inactive at Start, as the card has it.
On the right is the selected context’s Command Set. Below it, the Reuse a Command… list holds the Commands you’ve already made. Pick Fly from it, then Fire, Bomb and Confirm. Each one joins Flight.
Here’s the catch. A Command brings its name along, but not its keys. Each Input Context keeps keys of its own. So each Command you reuse shows Shared across Input Contexts, and no keys at all.
Give them the same keys as before. The card’s INPUT CONTEXTS block lists each set’s Commands, but not their keys, so the keys are here in the words.
Press Add Keybinding under a Command, click the new row, and press the key. Fly has a key for each direction, so each of its rows has a list for its direction too. Its keys are the arrows and W, A, S and D, as in Chapter 1. Fire is Space and J, Bomb is B and K, and Confirm is Enter.
The card’s COMMANDS block has two new Commands. Press Add Command while Flight is selected, and make Pause, a Button, with Escape and P. A new Command joins the context that’s selected.
Now Menus. Add it the same way, and reuse Fly and Confirm. Fly gets the same keys again.
The menu only listens for Up and Down, but it’s the same Command, so it may as well have them all. Confirm gets Enter and Space. Then add Back, a new Button, with Escape and Backspace.
A right click is Back too. The card’s COMMANDS block lists only Back’s keys, but the click belongs to the game as well. Press Add Keybinding, click the new row, and then right-click it. The row reads the mouse button the same way it reads a key.
Last, Title. It comes last for a reason: a Command taken out of the only context that holds it is deleted from your project, with its keys. By now Flight holds Fly, Fire and Bomb, so they’re safe.
Select Title, and take out the Commands it no longer needs, with the red trash button at the right end of each Command’s row. Press it for Fly, Fire and Bomb. Only Confirm is left.
Give it Space too, and a left click. The click takes two. Press Add Keybinding, and click the new row: that click only starts it listening. Then click once more, and the row keeps it as Left.
Now a click anywhere on the Title takes off.
10.4.2 Use Flight Controls
When a Scene starts, only the context that’s Active at Start is on. That’s Title, in every Scene. So the mission has to switch on its own set.
Use Flight Controls does it, the moment Gameplay starts: it switches Flight on, and Title off.
Set Input Context Active has a list of your Input Contexts. It starts on Title, the one that’s Active at Start. Pick Flight in the first block, and leave its Active on Yes, as it starts. The second block stays on Title, so pick No in its Active list, as the card has it.
It needs no Variables. Attach it to Game Rules, below Mission Complete.
When a mission starts, the Flight controls are on and the Title controls off.
Any Object- Input Context
Flight
- Input Context
Title- Active
No
Save, and run the game. Nothing looks any different from Chapter 9’s game, and that’s the point. The Fighter flies, Space fires, and B drops a bomb, as before. If it won’t fly at all, look in Flight: the keys you gave Fly may be missing.
10.5 The Title
Now the front door itself.
10.5.1 The Title Scene
Make a new Scene with Add > Scene, and name it Title. The card’s SCENE Title block gives its settings, the same as Gameplay’s. Its Main Camera sees the same piece of sea, and its Main View sits in the same window. Add the Pacific Ocean under Screen Backgrounds. Then give the Scene the card’s Background Color.
You set a Scene’s camera, view and background once before, in Chapter 1. If the clicks have faded, the Set up card in Making what a card shows has them.
The Title’s sea has the same scenery as Gameplay’s. Place each one from the card’s PLACE THESE for the Title, at the same X and Y it has in Gameplay, from Chapter 5. Only the High Cloud isn’t on the Title’s list.
Place the Screen Frame too, at 0 and 0, so the riveted wall frames the Title as it frames Gameplay.
10.5.2 Patrol
The Fighter on the Title doesn’t fly. It bobs, as if it were holding its place in the wind. That’s Patrol, the Sky Fortress’s slow sway from Chapter 9, at gentler speeds.
Patrol’s blocks need no change for it. Its Changes card adds the Title Plane to its top line, and gives it a new Description, which says what the Title needs too. It starts its sway from where it was when it appeared.
While on, drifts side to side and up and down in a slow wave around where it started patrolling (when it appeared, or when it was switched on).
Any Objectself.patrolData- Component Value
self.patrolData.secondsPatrolled- Operator
+=- Value
$deltaTime
- X Velocity
cos(@self.sideRate * self.patrolData.secondsPatrolled) * @self.sideSpeed- Y Velocity
sin(@self.bobRate * self.patrolData.secondsPatrolled) * @self.bobSpeed
10.5.3 Title Plane
The Title Plane is a picture of the Fighter. It has no Collider, so make it an Empty Object, and attach a Sprite with the Fighter Art, 3 meters by 3.
Attach Patrol, and it brings Patrol Data along by itself. Under Shared Variables, type its four numbers. Its sideSpeed is far below the one Patrol starts with, so the plane drifts only a little. Its two rates are a touch higher, so each sway comes round a little sooner. Then Cast Shadow, with the Fighter Shadow, so it casts its shadow on the clouds like the real one.
X 3, Y 330Fighter ArtX 3, Y 3PatrolPatrol DataFighter Shadow1.031-1.8750.5690.70.51.6Place it from PLACE THESE, near the bottom middle of the sea.
10.5.4 Title Logo and Title High Score
The Title Logo is the gold SKY ACE on its red banner, the Title Logo Art at 640 by 300 pixels. It sits on the screen, at Top Center.
The Title High Score is a Text / UI at Bottom Center. Its words are HIGH SCORE, two spaces, then {$highScore}, so it shows the number High Score reads. Leave its Color as a new Text starts, white.
Window / UITop CenterUIX 128, Y 128110Title Logo ArtX 640, Y 300Window / UIBottom CenterUIX 128, Y 48HIGH SCORE {$highScore}Bebas Neue261CenterWrap to Width60010.5.5 The Take-Off Prompt
PRESS ENTER TO TAKE OFF is three pieces in a row, at Bottom Center: the word PRESS, a picture of the Enter key, and the words TO TAKE OFF. All three blink together.
Take Off Press is a Text / UI in Bebas Neue, a pale gold. Take Off Words is its twin: Duplicate it, name the copy Take Off Words, and change its Text and its Size X. Take Off Key is the Key Enter Icon, 92 by 46 pixels.
Each one has Blink, from Chapter 9, switched on this time. Leave its numbers as they start. The Warning Banner blinked faster, with numbers of its own, but the prompt keeps Blink’s: a slow, steady blink.
Window / UIBottom CenterUIX 128, Y 48PRESSBebas Neue40#FFE8A31CenterWrap to Width92Window / UIBottom CenterUIX 128, Y 48TO TAKE OFFBebas Neue40#FFE8A31CenterWrap to Width171Window / UIBottom CenterUIX 128, Y 128120Key Enter IconX 92, Y 46Place the three from PLACE THESE, with their Z-Indexes, and place the logo and the high score too.
10.5.6 Title Music
The Title Theme starts the moment the game does. Title Music has one Event, When the Game Starts, a Game Start Event in the Add Event window. It runs once, when the whole game begins, and never again.
That matters. The Title and the Main Menu share the Title Theme, and going between them shouldn’t start it over. A Scene Start Event would. Game Start doesn’t.
Loops the Title Theme from the moment the game starts.
Any Object- Operation
Loop- Sound
"Title Theme"
10.5.7 Title Controls
Title Controls is the Title’s Game Rules: an Empty Object with no picture, placed at 0 and 0. Attach Title Music.
Then attach High Score, from Chapter 4, as it is. When the Title opens, it reads the high score from this device, as it does when a mission starts. Its changes come in the part called Pause. Take Off comes in the next part, so leave its line on the card for now.
X 3, Y 3Place Title Controls from PLACE THESE.
10.5.8 Start Scene
The game should open on the Title now. In the Game Settings, under General, pick Title · 2D in Start Scene. That’s the card’s GAME SETTINGS line.
Save, and run the game. The sea slides by under the clouds, as it does in a mission. The SKY ACE banner shines at the top, and your Fighter bobs under it, side to side. Its shadow falls on the clouds as they pass. HIGH SCORE shows your best.
PRESS ENTER TO TAKE OFF blinks at the bottom. The Title Theme plays.
Press Enter, and nothing happens yet, because there’s nowhere to go. That’s the next part.
For now, there’s no way into a mission either. If you’d like to fly one while you build, pick Gameplay · 2D in Start Scene for a while, and pick Title again after.
10.7 How to Play
Now the panel that HOW TO PLAY opens. It’s a dark sheet over the menu, titled HOW TO PLAY, with PILOT QUICK GUIDE under it. It shows the keys for MOVE, FIRE, BOMB and PAUSE, the five pickups and what each one gives, the way the mission goes, and how to close it.
10.7.1 Show With How to Play
Every piece of the panel has Show With How to Play, which shows its piece when howToPlayOpened comes and hides it when howToPlayClosed comes. It has no Variables. Each Set Visible’s Visible is a list that starts on No, so pick Yes in the first, and leave the second.
Shows this How to Play piece while the panel is open.
Any Object- Visible
Yes
- Visible
No
10.7.2 Six Objects
The panel looks like dozens of pieces, but it’s six Objects, each placed many times. Every placement gets its own words, picture, size or color with Edit Object Locally.
The How to Play Veil is the White Pixel, stretched over the whole window, and tinted almost black on its placement. The How to Play Panel is the Large Panel Art. The How to Play Strip is the White Pixel again, a dark band for each row of keys.
The How to Play Text is words, HOW TO PLAY in gold. The How to Play Key is a key’s picture, and the How to Play Pickup a pickup’s. Each starts with one picture, and each placement picks its own.
All six are on the screen, and each has Show With How to Play.
Window / UICenterUIX 128, Y 128150White PixelX 720, Y 960#04101CWindow / UICenterUIX 128, Y 128151Large Panel ArtX 640, Y 840Window / UITop CenterUIX 128, Y 128152White PixelX 568, Y 82#142C3DWindow / UITop CenterUIX 128, Y 48HOW TO PLAYBebas Neue44#F4C5421CenterWrap to Width560Window / UITop CenterUIX 128, Y 128155Key Up IconX 34, Y 34Window / UICenterUIX 128, Y 128153Power Pickup ArtX 42, Y 4210.7.3 Placing the Panel
This is the longest list of placements in the book. It’s long, but there’s nothing new in it after the first few. Every placement is hidden, so turn off Visible at Game Start on each one.
It helps to see its pattern. The veil and the panel come first, then the titles. Then each row of keys: a strip, a word on the left, and key pictures, with OR between two sets. After the keys come PICKUPS and five rows, each a pickup’s picture, its name in its own color, and what it gives. Last, a thin line, 4 WAVES and SKY FORTRESS, and the way back.
Some placements pick their Screen Anchor, Center or Bottom Center, so pick it first, then type the Screen Offset.
Then each one’s (Edit Object Locally) lines. A word’s Text, Font Size, Color and Size X are all in its Text / UI. A key’s or a pickup’s picture and size are in its Sprite.
The veil and the strips need one more thing, and the rows of PLACE THESE don’t show it: their Tint. It’s on their Object cards, Tint (on its placement). It goes on the veil’s placement and on each strip’s, the way the Result Veil got its own in Chapter 4. The one strip that’s a thin line is the exception. Its own lighter Tint comes in its (Edit Object Locally) lines instead.
Myth can save you some of the typing. Right-click a placement in the Scene and choose Duplicate, or press Ctrl+D.
The copy has everything the first one had: hidden, its anchor, its Z-Index, its Tint and its (Edit Object Locally) values. Type its Screen Offset. Then change only what differs. A strip copied from a strip has its Tint already.
If your rows don’t line up, the catch-up download in the Goal has the panel finished, to compare. And a break halfway through is fine too.
Save, and run the game. Choose HOW TO PLAY. The dark sheet covers the menu, with every key, every pickup and the way the mission goes. Up and Down do nothing, and the mouse doesn’t light the buttons under it. Press Esc, or Enter, and it’s gone, with a click.
10.8 Pause
Now a way to stop for a moment, in the middle of a fight.
10.8.2 Keep a Better Score and High Score
High Score keeps a better score when the mission ends. Now it needs to do that from two places, so its If moves into a Function of its own, Keep a Better Score.
The Function holds what was High Score’s inner If: when $score beats $highScore, it takes the score and saves it. Its Save Persistent Value’s Action Name is highScoreSaved now, so type that over the one it starts with.
Saves the score as the high score on this device when it beats the high score.
$score > $highScore- Variable
$highScore- Value
$score
- Action Name
highScoreSaved- Key
"highScore"- Value
$highScore
On High Score’s Changes card, the inner If is struck, with both its blocks. Click it and delete it, and the two go with it. Then add a call to Keep a Better Score with the outer If’s Add inside Then.
The second place is a new Event, On Mission Quit. Nothing sends missionQuit yet, so add it with Add Custom Event…. It calls Keep a Better Score too. A mission quit from the PAUSED menu never reaches a Game State, so this is how its score gets kept.
The card’s top line names three Objects now. You attached High Score to Title Controls and Menu Controls already. Type its new Description too.
Reads the high score from this device when a Scene starts, and saves a better score when the mission ends.
Any Object- Action Name
savedHighScore- Key
"highScore"- Default
0
- Variable
$highScore- Value
savedHighScore.value
- Action Name
missionFailed- Game State
Mission Failed
- Action Name
missionComplete- Game State
Mission Complete
missionFailed.value == true || missionComplete.value == true$score > $highScore- Variable
$highScore- Value
$score
- Action Name
persistentWriteResult- Key
"highScore"- Value
$highScore
10.8.3 Pause Overlay Lifecycle
The PAUSED menu itself comes with Myth Engine. Pause Overlay Lifecycle pauses the whole game and shows a menu over it, and hides it again.
Make it with Add > Logic Component, and pick it in the Starter list, under UI, as you made Top-down Controls in Chapter 1. Its Events come built, so its card is short. Its Description comes with it, in Myth’s own words. In plain ones, it pauses the game and shows a menu over it.
Composes global simulation pause with the independent viewport-fixed pause-overlay transport.
Any ObjectIts one Shared Variable is a Text, pauseMenuSpec. It describes the menu. Its Starting Value is Myth’s own small menu, Paused with one line, Resume. That one is there already, so there’s nothing to type here.
Sky Ace’s menu says PAUSED, with two lines: RESUME MISSION sends resumePauseOverlay, and QUIT TO MAIN MENU sends quitMission. Esc in the menu sends resumePauseOverlay too.
That longer value belongs to Game Rules. Attach Pause Overlay Lifecycle to Game Rules, and pauseMenuSpec joins its Shared Variables, with a Value box of its own.
The value to type is on the Game Rules card, at the end of this chapter. Look under Shared Variables, on its pauseMenuSpec line.
A Text’s Value box keeps what you type as it is, braces and double quotes too. So click it, delete Myth’s small menu, and type the card’s line exactly, with no spaces of your own. The card’s line may wrap on your screen, but in your box it’s one line. RESUME MISSION and QUIT TO MAIN MENU keep their single spaces.
10.8.4 Pause
Pause opens the menu, and answers it.
When Pause is pressed, it asks Check Game State whether the mission is still being played. On the result screens, Esc means MAIN MENU or RETURN TO BASE, not a pause. If it’s Playing, it clicks Menu Move and sends showPauseOverlay, and Pause Overlay Lifecycle hears that and pauses the game.
When resumePauseOverlay comes, it plays Menu Select. The overlay hides itself and goes on with the game.
When quitMission comes, Pause cleans up. It sends hidePauseOverlay, and Set Game Paused takes 0, to go on. Its box starts at 1, which pauses. Then missionQuit, so High Score keeps a better score, and Back to the Main Menu.
resumePauseOverlay may be in Add Event’s list already, since the overlay listens for it. If it isn’t, add it with Add Custom Event…, and quitMission the same way.
During the mission, Pause (Esc, P) opens the PAUSED menu: RESUME MISSION continues, QUIT TO MAIN MENU keeps a better score and goes back to the Main Menu.
Any Object- Action Name
stillPlaying- Game State
Playing
stillPlaying.value == true- Sound
"Menu Move"
- Custom Event
showPauseOverlay
- Sound
"Menu Select"
- Custom Event
hidePauseOverlay
- Paused (1 pause / 0 resume)
0
- Custom Event
missionQuit
Attach Pause to Game Rules, after Pause Overlay Lifecycle.
Save, and run the game. Take off, start a mission, and press Esc. Everything stops. The PAUSED menu shows RESUME MISSION and QUIT TO MAIN MENU. Choose RESUME MISSION, or press Esc again, and the fight goes on from where it was.
Pause once more, and choose QUIT TO MAIN MENU. The Battle Theme stops, the Title Theme starts, and the Main Menu opens. If your score was a new best, it’s waiting there.
10.9 The Way Home
Last, the end of a mission. GAME OVER needs MAIN MENU beside FLY AGAIN, and the won mission’s RETURN TO BASE needs to go somewhere. That’s the promise Chapter 9 left you.
10.9.1 Fly Again
Fly Again gets a third Event. On the Game Over screen, Esc goes to the Main Menu: its Command is Pause, and it calls Back to the Main Menu. The call’s Fade Seconds box can stay as it starts. Type its new Description too.
On the Game Over screen, Confirm (Enter) or Fire starts a new mission and Pause (Esc) goes to the Main Menu. It is off until the result screen shows (Mission Over turns it on).
Any Object- caller
self
- caller
self
10.9.3 Return to Base
Return to Base is Fly Again’s twin for a won mission: Confirm, Fire or Pause, any of them, calls Back to the Main Menu.
It’s attached to Game Rules switched off, so click its switch gray. The next piece turns it on.
On the Mission Complete screen, Confirm (Enter), Fire or Pause goes back to the Main Menu. It is off until the result screen shows (Mission Over turns it on).
Any Object10.9.4 Mission Over
Mission Over switches on Fly Again after a loss, and now, after a win, it switches on Return to Base.
In On the Result Screen Timer, its If gets an Else. Right-click the If and choose Add Else, and then Add inside Else adds Set Logic State. Pick Return to Base in its Logic Component list. Its Description changes too.
When the mission ends, the result screen shows a moment later (resultSeconds after a loss, victorySeconds after a win); then FLY AGAIN and MAIN MENU after a loss, or RETURN TO BASE after a win, are switched on.
Any Object- Action Name
missionFailed- Game State
Mission Failed
- Action Name
missionComplete- Game State
Mission Complete
missionFailed.value == true || missionComplete.value == truemissionFailed.value == true- Timer Name
resultScreen- First Delay (s)
@self.resultSeconds- Ring Once
Yes
- Timer Name
resultScreen- First Delay (s)
@self.victorySeconds- Ring Once
Yes
- Custom Event
showResults
- Action Name
endedInFailure- Game State
Mission Failed
endedInFailure.value == true- Logic Component
"Fly Again"
- Logic Component
"Return to Base"
10.9.5 Game Rules
Here’s Game Rules now, with its four new rows at the bottom. Its pauseMenuSpec line, under Shared Variables, is the one you typed in the part called Pause. You attached Use Flight Controls, Pause Overlay Lifecycle and Pause before Return to Base, so yours sits last, not between them. That’s fine here. None of them needs another to go first.
X 3, Y 3Run Mission TimelineRun Mission Timeline Data{"title":"PAUSED","escape":"resumePauseOverlay","items":[{"id":"resumePauseOverlay","label":"RESUME MISSION"},{"id":"quitMission","label":"QUIT TO MAIN MENU"}]}Save, and run the game. Lose a mission on purpose, as quickly as you like. GAME OVER shows FLY AGAIN and MAIN MENU side by side, each with its key. Press Esc, and you’re on the Main Menu.
10.10 The Whole Game
Now fly the whole game, from the front door to the Sky Fortress and home again.
Save, and run the game. Take off, start the mission, and fly all four waves. Bring down the Sky Fortress, and press Enter at MISSION COMPLETE.
Watch for each of these.
- The game opens on the Title: the sea, the SKY ACE banner, the Fighter bobbing side to side, HIGH SCORE, and PRESS ENTER TO TAKE OFF blinking. The Title Theme plays.
- Enter, Space or a left click fades to the Main Menu, with a click of Menu Select. The Title Theme plays on.
- START MISSION is lit red. Up and Down move the light, and it wraps around. The mouse lights a button too.
- HOW TO PLAY covers the menu with the dark sheet. While it’s open, Up, Down and the mouse do nothing. Enter or Esc closes it.
- Esc on the Main Menu goes back to the Title.
- START MISSION fades into the mission in half a second, a little slower than the menus’ fade. The Title Theme stops, and the Battle Theme starts.
- In the mission, Space only fires, and Enter does nothing at all. Esc opens PAUSED. Everything stops, the mission clock too, and RESUME MISSION goes on from where it was.
- QUIT TO MAIN MENU goes back to the menu. It keeps your score if it’s a new best.
- GAME OVER shows FLY AGAIN and MAIN MENU: Enter flies again, and Esc goes to the menu.
- MISSION COMPLETE shows RETURN TO BASE. Enter, Space or Esc takes you to the Main Menu, and the Title Theme comes back.
- After a mission, go back to the Title, where HIGH SCORE shows your best.
- QUIT GAME ends the game.
Sky Ace has three Scenes now. The Title and the Main Menu share the sea, and the mission has the fight. Go to Scene moves between them. Each Scene switches on its own Input Context, so one key can take off, choose or fire.
On the Main Menu, one number is the choice, and every piece watches it. The keys and the mouse change it. The lit buttons follow it. Enter asks the chosen button to do its job, and Do What Was Chosen does the one that matches its choice.
Underneath is one idea you’ve used all along: a piece of Logic that knows only its own small job. Menu Choice doesn’t know what starting a mission means. It knows its own choice. It hands the job on. That’s why three placements of one Object can do three different things.
10.11 If It Didn’t Work
Something may be a little off the first time. That’s normal. This chapter has more settings than any other, so run the game, find the screen that misbehaves, and watch what it does.
The Fighter won’t fly in the mission, or won’t fire? Look at Flight in the Input Manager, where each reused Command needs its keys. Then look at Use Flight Controls on Game Rules: Flight on, Title off.
The Title’s keys still work on the menu? Use Menu Controls should switch Title off, with No in its Active.
The game still opens in a mission? Start Scene, under General in the Game Settings, should say Title · 2D.
The Title is there, but Enter does nothing? Take Off should be on Title Controls, and Title Controls placed on the Title. Confirm needs Enter in the Title context.
A Command is gone from the Input Manager altogether? It was taken out of the last context that held it. Make it again with Add Command, reuse it where the card lists it, and give it its keys. Its Logic finds it by name.
The menu opens, but no button is lit? Look at Lit When Chosen’s two Events: in each call, caller should say self, and choice should say self.choice. Each Menu Button Lit placement needs its choice, the same as its button’s.
Two buttons are lit at once? One Menu Button Lit placement has the wrong choice in its Logic row.
Enter on the menu does nothing? Main Menu Keys sends menuConfirmed, and Menu Choice listens for it. Then look at Do What Was Chosen. Its three Ifs ask about $menuChoice, with 0, 1 and 2, and each calls its job.
The wrong button’s job runs? A Menu Button placement’s choice doesn’t match its row. START MISSION is 0, HOW TO PLAY 1, and QUIT GAME 2.
The mouse does nothing? The Menu Button needs its Collider, as a Sensor.
After HOW TO PLAY, the keys never come back? Close How to Play should send howToPlayClosed, and Main Menu Keys’ On How to Play Closed should turn all four Events back to Choosing.
The panel shows only some pieces, or shows from the start? Each placement needs Show With How to Play on its Object, and Visible at Game Start off.
Two Title Themes play over each other, or it starts over on the menu? Title Music’s Event should be Game Start, not Scene Start.
The Title Theme goes on into the mission? The first step of Mission Music’s When the Scene Starts should stop it.
Esc does nothing in a mission? Pause belongs in Flight, with Escape and P. Then look at Pause on Game Rules, and Pause Overlay Lifecycle before it.
The PAUSED menu is empty, or Myth says something is wrong with pauseMenuSpec? Look at it under Game Rules’ Shared Variables. Hold it beside the card’s line. It starts with a brace, and every name keeps its double quotes.
QUIT TO MAIN MENU leaves the game frozen? Pause’s On Quit Mission needs Set Game Paused with 0.
RETURN TO BASE does nothing? Return to Base should be on Game Rules, switched off, and Mission Over’s new Else should switch it on.
Each of these is one small fix. Make it, run the game again, and you’re back with the chapter. And to compare, the catch-up download in the Goal is this chapter’s game, finished.
One thing first. Save a copy to try things in. Choose File > Save as… and give the copy a new name. Myth goes on in the copy, and your game stays as it is.
The menu has room for a fourth button. Place a fourth Menu Button, Lit and Label, give them Choice 3, and type 4 in Main Menu Keys’ buttonCount. What would it do? Give Do What Was Chosen a fourth If, for 3, and a Function of your own to call.
Or make your own game. You’ve built a fighter, its guns, four waves of enemies, a giant, a sea, and a front door. Which of them would you keep? What would you make that no one has made yet?
Still stuck? Search the manual, or ask in the Myth Engine Discord (opens a new tab).
Once, your Fighter waited alone near the bottom of an empty sea. Now it takes off from your own Title, and the whole sky is yours.
Free demo
Free
- No time limit
- Build, save and playtest your games
- Follow every game guide and build its game
Publishing needs the full version.
Try the free demoFull version
$84.99 USD, once
No subscription, no paid upgrades, every update included.
Everything in the free demo, plus:
- Publish your game as one HTML file, a web folder, or desktop and mobile projects you build and sign
- Share it or sell it, with no royalties, however much it earns
- Let players build their own version of your game, within the parts you allow (Builder Mode)
Windows 10/11, 64-bit · One person, on computers you own or control · Checkout and downloads through itch.io · Made by 3D Mage
License agreementMac, refunds and other questionsWhy pay for Myth Engine when free engines exist?
