Build a GameCreating Sky Ace

9  The Sky Fortress

Goal

The Sky Fortress comes. A WARNING blinks, a siren wails, and the music turns. A long gray giant comes down under its own health bar and fires fans of shells. Hurt it to half, and it rages, with rings of shells and Zero Fighter escorts. Bring it down, and it sinks in a chain of explosions, and MISSION COMPLETE: THE SKY FORTRESS HAS FALLEN.

The game as it is at the end of this chapter. Click the game to play.

This chapter builds on Chapter 8’s game. Starting here? The catch-up download in Chapter 8’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, or start Chapter 10 from it.

Sky Ace, Chapter 9 finishedZip of a Myth project · 4.2 MB

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.

9.1 The Idea

Wave 4 is over. The HEAVY SQUADRON has come and gone, and the sky is quiet for a moment. Then STAGE says BOSS. A siren wails, and a banner striped in black and yellow blinks in the middle of the screen: WARNING, HEAVY SKY FORTRESS APPROACHING. The Battle Theme stops, and the Boss Theme starts.

A long gray giant slides down from the top, with a row of round domes down its back. It’s four times the size of a Heavy Bomber. A bar appears at the top of the window, SKY FORTRESS, full and red. The giant stops, drifts from side to side, and opens fire.

This is the last enemy. Everything you’ve built meets it: your guns, your bombs, your medkits.

It isn’t another plane, though. A Heavy Bomber takes its hits and goes down. The Sky Fortress has a fight with a shape.

It comes down untouchable. Then it fights. At half its health it becomes enraged, the game’s word for its second, angrier way of fighting. And when its health is gone, it doesn’t vanish. It sinks.

So this chapter’s idea is switching Logic on and off. The Sky Fortress carries everything it will ever do from the start, but most of it is switched off. As the fight goes on, its own Logic switches pieces on and off: the guns of the first half off, the angrier guns on.

Think of a ship’s crew at stations. Every gunner is aboard from the start. Each one waits for the order to man the guns, and not one fires before it comes.

The order comes as a message. The Sky Fortress’s meter reaches a mark, and one piece of Logic gives the orders.

There’s a health bar too, at the top of the window, that shrinks with every hit. And when the giant falls, the mission is won. Your game gets its second ending, the one where you win.

9.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 Boss row’s time comes -> Run Waves sends fortressWarning -> the WARNING blinks, with the Warning Siren, and Mission Music plays the Boss Theme.
  • The Sky Fortress’s row comes -> Make a Row Arrive makes it -> Sky Fortress Battle sends fortressArrived, and the health bar shows.
  • The Sky Fortress reaches fightY -> Sky Fortress Battle switches on Takes Hits, Patrol and Fortress Guns.
  • A round hits it -> Takes Hits counts it and sends hitCounted -> Sky Fortress Battle sends fortressDamaged -> the bar shrinks.
  • The meter reaches half -> Sky Fortress Battle’s Enraged switches the guns, sends fortressEnraged -> the ENRAGED banner shows, and Calls Escorts sends Zero Fighters.
  • The meter reaches full -> Go Down sends fortressDown -> enemy rounds break, and the Sky Fortress sinks.
  • It has sunk -> fortressSunk -> Mission Complete wins the mission -> everything that watches the Game State answers.

9.3 Set Up

This chapter uses seven more pictures and four more sounds. They’re in your project already.

There’s one more Game State, Mission Complete. Open the Game Settings, choose General, and press the + under the Game State list. Type Mission Complete, as you did for Mission Failed in Chapter 4.

PLACE THESE lists seven Objects this chapter makes. Place each one in the part that makes it. CHANGE THESE PLACEMENTS and REMOVED come in the last part, Mission complete.

Don’t delete Mission Failed when you reach REMOVED. In that part it gets a new name, and keeps its blocks.

Set upWhat this chapter adds
ART (sprites, from the starter kit)
Sky Fortress Art
Sky Fortress Shadow Art
Warning Banner Art
Boss Bar Frame Art
Boss Bar Fill Art
Fortress Shell Art
Mission Complete Banner Art
SOUNDS (from the starter kit)
Warning Siren
Boss Theme
Explosion Boss
Victory Jingle
GAME SETTINGS > General > Game State
Available Game StatesPlaying, Mission Failed, Mission Complete
SCENE Gameplay: PLACE THESE
ObjectXY
Warning Banner0100hidden
Health Bar Frame0-160hidden
Health Bar Fill-264-167hidden
Health Bar Name0-148hidden
with Z-Index = 106
Mission Complete Banner0120hidden
with Per Instance Variables > State = mission-complete
Return Key-82-172hidden
with Per Instance Variables > State = mission-complete
Return Prompt42-172hidden
with Z-Index = 142
with Per Instance Variables > State = mission-complete
SCENE Gameplay: CHANGE THESE PLACEMENTS
Result VeilLogic values:Per Instance Variables > Opacity = 0.6, Per Instance Variables > Any Ending = Yes
Final ScoreLogic values:Per Instance Variables > Any Ending = Yes
Result High ScoreLogic values:Per Instance Variables > Any Ending = Yes
REMOVED
Logic Component: Mission Failed

9.4 The Warning

First, the warning.

9.4.1 Waves

The Waves table gets a fifth row, for the Sky Fortress. Its label is BOSS, so STAGE says BOSS when it starts, and its startSeconds is 112.

Its banner is empty, because no banner strip rolls in for it. Something else shows instead. So the table gets one more column, warning, a Yes/No. Only the Boss row says Yes.

The table’s columns come from its Data Structure, Waves Entry, from Chapter 6. So open Waves Entry, press Add Field, and type warning over localVariable. Pick Boolean in its Type list, and its Value becomes a switch reading No, the card’s false. The Waves table takes the column by itself, as Enemy Types took bigExplosion in Chapter 7, and every row’s switch reads Off.

Data StructureWaves EntryAddDelete

One row of the "Waves" Data Table.

startSecondsNumberdefault 0
labelTextdefault (empty)
bannerTextdefault (empty)
warningBooleandefault false

Then Add Row. Myth names the new row Row, so double-click the name and type Boss. Give it its values. Leave its banner empty, as a new row starts, and switch its warning On.

Data TableWavesData Structure: Waves EntryAddDelete
Row 0Wave 1
startSeconds1
labelWAVE 1
bannerWAVE 1 - CORAL SEA PATROL
warningNo
Row 1Wave 2
startSeconds26
labelWAVE 2
bannerWAVE 2 - ACES HIGH
warningNo
Row 2Wave 3
startSeconds52
labelWAVE 3
bannerWAVE 3 - DIVE BOMBERS
warningNo
Row 3Wave 4
startSeconds80
labelWAVE 4
bannerWAVE 4 - HEAVY SQUADRON
warningNo
Row 4Boss
startSeconds112
labelBOSS
banner
warningYes

9.4.2 Run Waves

When a wave’s time comes, Run Waves raises its banner with waveStarted. Now it asks a question first. Is this row a warning? If it is, Run Waves sends fortressWarning instead of waveStarted, and no banner rolls in.

On the Changes card, the old Trigger Custom Event is struck, and in its place comes a new If, step 5, with its Else. The rest stays.

Right-click the old Trigger Custom Event, choose Delete, and then add an If from the Action List. It lands loose, beside the line. It goes in the middle of the outer If’s True line, where the old block was. So drag it onto the arrow between the banner’s Change Variable and Change Component Value. Hold it there. The bar under the canvas names the two blocks it will go between. Let go, and it joins the line there.

Its condition is one box. Type it whole: data("Waves", self.runWavesData.nextWave, "warning") == true, the row’s warning.

Right-click the new If, and Add inside Then adds Trigger Custom Event, with fortressWarning. Then Add Else, and Add inside Else adds the other Trigger Custom Event, for waveStarted. Join each with Connect to sequence.

Logic ComponentRun WavesAttach to: Game RulesAddDelete

Starts each wave of the Waves table at its mission time: the HUD shows it and its banner is raised.

Attach toAny Object
DATA STRUCTURES
Run Waves Dataself.runWavesData
When Created
WhenCreate
1Change Variable
Variable
$wave
Value
data("Waves", self.runWavesData.nextWave, "label")
2Start Recurring Timer
Timer Name
wave
First Delay (s)
data("Waves", self.runWavesData.nextWave, "startSeconds") - $missionTime
Ring Once
Yes
On the Wave Timer
WhenRecurring TimerTimer name: wave
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true
Then
3Change Variable
Variable
$wave
Value
data("Waves", self.runWavesData.nextWave, "label")
4Change Variable
Variable
$banner
Value
data("Waves", self.runWavesData.nextWave, "banner")
5Trigger Custom Event
Custom Event
waveStarted
5Ifdata("Waves", self.runWavesData.nextWave, "warning") == true
Then
6Trigger Custom Event
Custom Event
fortressWarning
7Otherwise
8Trigger Custom Event
Custom Event
waveStarted
9Change Component Value
Component Value
self.runWavesData.nextWave
Operator
+=
Value
1
10Ifself.runWavesData.nextWave < dataCount("Waves")
Then
11Start Recurring Timer
Timer Name
wave
First Delay (s)
data("Waves", self.runWavesData.nextWave, "startSeconds") - $missionTime
Ring Once
Yes

9.4.3 Mission Music

The music turns when the warning comes. Mission Music gets a new Event, On Fortress Warning, which stops the Battle Theme and loops the Boss Theme. Run Waves sends fortressWarning now, so Add Event’s window knows the name. Type it into the filter, and pick it.

The end of the mission changes too, for the win that comes later in this chapter. On Game State Changed asks one more question. Add a new Check Game State, type missionComplete over its Action Name, and pick Mission Complete in its list. It goes second, so drag it onto the arrow between the first Check Game State and the If, as you did for Shot Down in Chapter 8.

The If’s condition grows a second part. Click its box, and type the card’s whole condition over the old one: missionFailed.value == true || missionComplete.value == true. The || means or. Now the If’s line runs when the mission is lost or won, not only lost.

Inside it are the three Control Sounds that stopped the music. They’re steps 4, 5 and 6 now. Keep all three, and change what two of them do. Changing the old ones is the short way.

Step 5 stopped the Engine Drone. Now it stops the Boss Theme, so pick Boss Theme in its Sound list. Step 6 is the one that played the Game Over Jingle, and now it stops the Engine Drone. Pick Stop in its Operation, and Engine Drone in its Sound. On the card, step 6’s old Sound is struck above its two green lines.

Last comes a new If, with an Else. It asks which ending it was. The outer If’s Add inside Then adds it at the end of its line, where it belongs. A lost mission plays the Game Over Jingle. A won mission plays the Victory Jingle, the first time you’ll hear it.

Logic ComponentMission MusicAttach to: Game RulesAddDelete

Plays the Battle Theme and the engine drone during the mission, and the Game Over Jingle when it fails.

Attach toAny Object
When the Scene Starts
WhenScene Start
1Control Sound
Operation
Loop
Sound
"Battle Theme"
2Control Sound
Operation
Loop
Sound
"Engine Drone"
On Game State Changed
WhenGame State Changed
1Check Game State
Action Name
missionFailed
Game State
Mission Failed
2IfmissionFailed.value == true
Then
2Check Game State
Action Name
missionComplete
Game State
Mission Complete
3IfmissionFailed.value == true || missionComplete.value == true
Then
4Control Sound
Operation
Stop
Sound
"Battle Theme"
5Control Sound
Operation
Stop
Sound
"Boss Theme"
Sound
"Engine Drone"
6Control Sound
Sound
"Game Over Jingle"
Operation
Stop
Sound
"Engine Drone"
7IfmissionFailed.value == true
Then
8Control Sound
Sound
"Game Over Jingle"
9Otherwise
10Control Sound
Sound
"Victory Jingle"
On Fortress Warning
WhenfortressWarningCustom Event
1Control Sound
Operation
Stop
Sound
"Battle Theme"
2Control Sound
Operation
Loop
Sound
"Boss Theme"

9.4.6 Warning Banner

The Warning Banner is a dark band between black and yellow stripes, with WARNING in red and HEAVY SKY FORTRESS APPROACHING under it. It sits on the screen like a wave banner. Make it an Empty Object, and give it Window / UI, Center, and the Warning Banner Art at 720 by 150 pixels.

Attach Blink first, and switch it off, so its switch is gray. Blink Warning goes on after it. Under Shared Variables, its numbers are quicker than Blink’s own: a blink every 0.8 seconds, the first after 0.2, each one 0.55 seconds long.

ObjectWarning Banner
Transform
Presentation > SpaceWindow / UI
Presentation > Screen AnchorCenter
Presentation > Render LayerUI
Bounding Box > SizeX 128, Y 128
Sprite
Scene Depth Draw Order112
SpriteWarning Banner Art
Transform > SizeX 720, Y 150
Logic
Blink(turned off)
Blink Warning
Shared Variables
blinkGap0.8
firstShow0.2
showSeconds0.55

Place it from PLACE THESE, hidden.

To see the warning now, borrow Wave 1: in Waves, switch Wave 1’s warning On. Save, and run the game.

At the first second, there’s no WAVE 1 banner. A siren wails instead, and WARNING blinks in the middle of the screen. The Battle Theme stops, and the Boss Theme starts. A few seconds later, the banner is gone, and only the Boss Theme is left. Switch Wave 1’s warning Off again.

9.5 The Sky Fortress Comes Down

Now the giant itself.

9.5.1 Enemy Stats

The Sky Fortress carries Enemy Stats, like every enemy, with two more fields. The first, mark, is where its meter’s next mark is. The second, hitsTaken, keeps the meter itself, the hits it has taken so far.

Press Add Field twice, and type the card’s names over localVariable.

Data StructureEnemy StatsAddDelete

What every enemy carries; each enemy takes the values from its own row of Enemy Types. damage, mark and hitsTaken are working values every enemy starts from here (1, 0 and 0): the hits the next hit counts (Takes Hits), the damage at which the Sky Fortress next changes (Sky Fortress Battle) and the hits it has taken.

speedNumberdefault 0
healthNumberdefault 1
pointsNumberdefault 0
bigExplosionBooleandefault false
dropChanceNumberdefault 0
damageNumberdefault 1
markNumberdefault 0
hitsTakenNumberdefault 0

9.5.2 Enemy Types

Enemy Types gets a row for the Sky Fortress. Its health is 420, against a Heavy Bomber’s 36, and bringing it down is worth 25000 points. Its dropChance is 0. It leaves nothing behind but a won mission.

Enemy Types takes the two new columns by itself, every cell at 0, and 0 is what the card gives every plane. Then Add Row, and name the new row Sky Fortress, exactly as the Object will be named. The Sky Fortress’s Data Structure finds its row by that name. The new row starts at Enemy Stats’ defaults, so type its speed, health and points, and switch bigExplosion On.

Data TableEnemy TypesData Structure: Enemy StatsAddDelete
Row 0Zero Fighter
speed5.9375
health2
points100
bigExplosionNo
dropChance7
damage1
mark0
hitsTaken0
Row 1Red Ace
speed4.6875
health5
points300
bigExplosionNo
dropChance22
damage1
mark0
hitsTaken0
Row 2Dive Bomber
speed4.375
health6
points350
bigExplosionNo
dropChance18
damage1
mark0
hitsTaken0
Row 3Heavy Bomber
speed1.71875
health36
points2000
bigExplosionYes
dropChance100
damage1
mark0
hitsTaken0
Row 4Sky Fortress
speed3.4375
health420
points25000
bigExplosionYes
dropChance0
damage1
mark0
hitsTaken0

9.5.3 Sky Fortress Shadow

The Sky Fortress casts a shadow on the clouds, like every plane. Its shadow is a copy of the Heavy Bomber’s, from Chapter 7, made much bigger.

Duplicate the Heavy Bomber Shadow, and name the copy Sky Fortress Shadow. It keeps its Tag, Plane Shadow, and Shadow on Clouds with its Data. Pick Sky Fortress Shadow Art in its Sprite box. The rest is size, and a Draw Order one lower than the bomber shadow’s. It’s as big as the giant itself. Its card gives the numbers.

ObjectSky Fortress Shadow
Transform
Bounding Box > SizeX 12, Y 12
Sprite
Scene Depth Draw Order-14
SpriteSky Fortress Shadow Art
Transform > SizeX 12, Y 12
Collider
CollisionSensor
Shape and Transform > SizeX 12, Y 12
Tags and Interactions > InteractionsCollide Only With
Tags and Interactions > Collide Only WithTagged Cloud
Tags
Object TagsPlane Shadow
Data Structure
From LogicShadow on Clouds
Data StructureShadow on Clouds Data
Logic
Shadow on Clouds

9.5.4 Fortress Shell

The Sky Fortress fires its own kind of round, the Fortress Shell, a small pink ball. It’s a copy of the Enemy Round from Chapter 4. It keeps its Tag, Enemy Fire, and its Logic, so it breaks on the Fighter, breaks on a bomb and leaves the view the same way.

Duplicate the Enemy Round, name it Fortress Shell, pick Fortress Shell Art, and type its Collider’s Size, a little bigger.

ObjectFortress Shell
Transform
Bounding Box > SizeX 3, Y 3
Sprite
Scene Depth Draw Order45
SpriteFortress Shell Art
Transform > SizeX 3, Y 3
Collider
CollisionSensor
Shape and Transform > SizeX 0.438, Y 0.438
Tags and Interactions > InteractionsCollide Only With
Tags and Interactions > Collide Only WithFighter
Tags
Object TagsEnemy Fire
Logic
Remove When Out of View
Breaks on Fighter
Breaks on Bomb

9.5.5 Patrol

Once the Sky Fortress is in place, it doesn’t sit still. It drifts to one side, slows, drifts back, and bobs a little up and down as it goes. It’s a slow, heavy sway.

That’s Weave’s idea from Chapter 7, on two axes. The sideways speed follows cos, the wave that swings between plus one and minus one. The up and down speed follows sin, the same wave a quarter turn later. Each has its own rate and its own top speed.

Patrol keeps its own clock, secondsPatrolled. Every Step adds the step’s length, $deltaTime, to it, as Weave does in Chapter 7. The clock runs only while Patrol is on. So the sway starts from its beginning when the Sky Fortress is in place, drifting to the right, not up or down.

Its four numbers never change, so they’re its SHARED VARIABLES, all Constants. The clock changes as it flies, so it lives in a Data Structure of the Logic’s own, as Weave’s two did. Press the + on the Data Structures card and choose New Data Structure. Myth names it Patrol Data. Give it one field, secondsPatrolled, a Number at 0. Then pick Plus in Change Component Value’s Operator list.

Set Velocity has both boxes this time, because Patrol does all the moving while it’s on. Fly Down set the giant’s speed only once, when it appeared, so the two never fight.

Logic ComponentPatrolAttach to: Sky Fortress

While on, drifts side to side and up and down in a slow wave around where it started patrolling.

Attach toAny Object
DATA STRUCTURES
Patrol Dataself.patrolData
SHARED VARIABLES
NameTypeKindStarting Value
sideSpeedNumberConstant3.75
sideRateNumberConstant0.55
bobSpeedNumberConstant0.563
bobRateNumberConstant1.1
Every Step
WhenStep
1Change Component Value
Component Value
self.patrolData.secondsPatrolled
Operator
+=
Value
$deltaTime
2Set Velocity
X Velocity
cos(@self.sideRate * self.patrolData.secondsPatrolled) * @self.sideSpeed
Y Velocity
sin(@self.bobRate * self.patrolData.secondsPatrolled) * @self.bobSpeed

9.5.6 Fortress Guns

Fortress Guns fires the first half of the fight. A slow fan of shells sprays from the nose, around straight down. Between the fans, the two wing guns each fire one shell at the Fighter, on a quicker beat.

You’ve built every piece of this before. The fan is Fire a Spread, from Chapter 7, with direction 270, straight down. The aim is Aim Down at the Fighter, from Chapter 4. A wing gun is Fire a Spread with a count of 1 and an arc of 0, so the one shell flies straight at its aim. The two wings differ only in a minus: one fires from -@self.wingX, the other from @self.wingX.

The guns start with On Enable, when Sky Fortress Battle switches them on. Each timer then repeats on its own. Each time one rings, it asks whether the mission is still being played, and stops its timer once it isn’t. On Disable stops both timers, when the guns are switched off.

Make its SHARED VARIABLES first, all Constants. shell and fighter are Objects, and their Starting Value stays at None. The Sky Fortress picks them. Then come the fourteen numbers, and the Timer Names take fanGun and aimedGuns bare.

Each If is one box, and its Else comes from Add Else, as in Chapter 7. In each call, caller starts on self. Pick @self.shell in round’s list, and @self.fighter in the aim’s fighter list. Type the rest. Name the aim’s call wingAim, in its Action Name box.

Logic ComponentFortress GunsAttach to: Sky Fortress

While on, the Sky Fortress fires Phase 1: a fan of shells from its nose and aimed shells from its two wing guns.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
shellObjectConstantNone
fighterObjectConstantNone
fanCountNumberConstant7
fanArcNumberConstant70
fanSpeedNumberConstant7.188
fanFirstNumberConstant1
fanGapNumberConstant1.6
noseYNumberConstant-5.063
wingSpeedNumberConstant9.375
wingFirstNumberConstant1.8
wingGapNumberConstant0.95
wingXNumberConstant2.063
wingYNumberConstant-0.469
aimMinNumberConstant200
aimMaxNumberConstant340
enemyMuzzleFlashCountNumberConstant5
When Enabled
WhenOn Enable
1Start Recurring Timer
Timer Name
fanGun
Repeat Every (s)
@self.fanGap
First Delay (s)
@self.fanFirst
2Start Recurring Timer
Timer Name
aimedGuns
Repeat Every (s)
@self.wingGap
First Delay (s)
@self.wingFirst
On the Fan Gun Timer
WhenRecurring TimerTimer name: fanGun
1Check Game State
Action Name
stillPlayingForFan
Game State
Playing
2IfstillPlayingForFan.value == true
Then
3Fire a SpreadFunction
caller
self
round
@self.shell
count
@self.fanCount
direction
270
arc
@self.fanArc
speed
@self.fanSpeed
muzzleX
0
muzzleY
@self.noseY
4Burst Particles
Particles
"Enemy Muzzle Flash"
Y
@self.noseY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
5Control Sound
Sound
"Enemy Guns"
6Otherwise
7Stop Recurring Timer
Timer Name
fanGun
On the Aimed Guns Timer
WhenRecurring TimerTimer name: aimedGuns
1Check Game State
Action Name
stillPlayingForWingGuns
Game State
Playing
2IfstillPlayingForWingGuns.value == true
Then
3Aim Down at the FighterFunction
Action Name
wingAim
caller
self
fighter
@self.fighter
aimMin
@self.aimMin
aimMax
@self.aimMax
4Fire a SpreadFunction
caller
self
round
@self.shell
count
1
direction
wingAim.value
arc
0
speed
@self.wingSpeed
muzzleX
-@self.wingX
muzzleY
@self.wingY
5Burst Particles
Particles
"Enemy Muzzle Flash"
X
-@self.wingX
Y
@self.wingY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
6Fire a SpreadFunction
caller
self
round
@self.shell
count
1
direction
wingAim.value
arc
0
speed
@self.wingSpeed
muzzleX
@self.wingX
muzzleY
@self.wingY
7Burst Particles
Particles
"Enemy Muzzle Flash"
X
@self.wingX
Y
@self.wingY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
8Control Sound
Sound
"Enemy Guns"
9Otherwise
10Stop Recurring Timer
Timer Name
aimedGuns
When Disabled
WhenOn Disable
1Stop Recurring Timer
Timer Name
fanGun
2Stop Recurring Timer
Timer Name
aimedGuns

9.5.7 Sky Fortress Battle

Sky Fortress Battle gives the orders. This part builds its first three Events. The fourth, the meter’s Event, comes later in the chapter, with its two Modes.

When the Sky Fortress appears, its meter’s first mark goes at half its health. Change Component Value sets mark to self.enemyStats.health / 2.

Next it works out how long the Sky Fortress takes to come down to fightY, 25.625 meters: its height above fightY, divided by its speed. That’s secondsToPosition. The inPosition timer rings once, that many seconds later.

It’s the same sum as Drift Down’s, in Chapter 8, and the If does the same job too. A sum below zero becomes 0, so a Sky Fortress already below fightY doesn’t wait. Last, it sends fortressArrived, for the health bar.

When inPosition rings, the Sky Fortress is in place. Three Set Logic States switch on Takes Hits, Patrol and Fortress Guns. From that moment on, it can be hurt, it sways from side to side, and it fires. Until then, your rounds break on it and do nothing. That’s the untouchable descent.

The third Event, On Hit Counted, passes the news along. Takes Hits will send hitCounted on this Object each time it has counted a hit. Sky Fortress Battle answers with fortressDamaged, for everyone, and the health bar listens. Nothing sends hitCounted yet. Add it with Add Custom Event….

Make all its Variables now, the ones for later too. It reads the Sky Fortress’s Enemy Stats, so press the + on its Data Structures card, and pick Enemy Stats under Existing Data Structures. Then come its five SHARED VARIABLES, all Constants. First is fightY. Next, enragedWords is a Text, the banner’s words, so type THE FORTRESS IS ENRAGED! into its Starting Value, bare. Last come the three numbers for the show.

secondsToPosition is made by When Created itself, in its first step, a Declare Variable. It’s a Number, and its Value box starts empty, so type the card’s 0.

The card’s last two When Created steps have no indent, so they belong on the main line, after the If. Add each from the Action List, and join it with Connect to sequence. It goes under the If, above End.

The three Set Logic States go one after another. Their Logic Component is a list, so pick Takes Hits, Patrol and Fortress Guns, one in each. State stays on Enable.

Logic ComponentSky Fortress BattleAttach to: Sky Fortress

Brings the Sky Fortress into the fight: Fighter rounds cannot hurt it while it comes down; once at fightY it patrols, can be hurt and fires. While the mission is being played, at half health it is enraged; with no health left it stops fighting and sends fortressDown.

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
SHARED VARIABLES
NameTypeKindStarting Value
fightYNumberConstant25.625
enragedWordsTextConstantTHE FORTRESS IS ENRAGED!
enrageShakeStrengthNumberConstant0.015
enrageShakeSecondsNumberConstant0.6
enrageBigExplosionCountNumberConstant40
When Created
WhenCreate
1Declare Variable
Name
secondsToPosition
Value
0
2Change Component Value
Component Value
self.enemyStats.mark
Value
self.enemyStats.health / 2
3Change Variable
Variable
secondsToPosition
Value
(self.transform.position.y - @self.fightY) / self.enemyStats.speed
4IfsecondsToPosition < 0
Then
5Change Variable
Variable
secondsToPosition
Value
0
6Start Recurring Timer
Timer Name
inPosition
First Delay (s)
secondsToPosition
Ring Once
Yes
7Trigger Custom Event
Custom Event
fortressArrived
On the In Position Timer
WhenRecurring TimerTimer name: inPosition
1Set Logic State
Logic Component
"Takes Hits"
2Set Logic State
Logic Component
"Patrol"
3Set Logic State
Logic Component
"Fortress Guns"
On Hit Counted
WhenhitCountedCustom Event
1Trigger Custom Event
Custom Event
fortressDamaged

9.5.8 Sky Fortress

Now the giant. The Sky Fortress is a 2D Object, so its Collider is there already. Turn its Physics Object switch off, as for the planes, so nothing can shove it. Attach a Sprite with Sky Fortress Art, 12 meters by 12. Its Draw Order is 18.

It isn’t a copy of a plane, and it wears no Tag. A copy would bring Shot Down along, and go down in one burst the moment its meter reached its first mark. So it stands alone, built whole, with its own Logic. The rounds, the Fighter and Breaks on Hit will know it by its own name, Sky Fortress.

Its Collider’s box is a little smaller than its picture, and only the Fighter’s rounds and the Fighter itself may touch it. So pick Collide Only With under Tags and Interactions, and add Tagged Fighter Round and the Fighter.

Attach a Data Structure, Enemy Stats, from Data, with Input Source Data Table and the Enemy Types table, as on the Zero Fighter in Chapter 3. It fills from the row named Sky Fortress.

Now its Logic. Fly Down brings it down, at the speed in its row. Takes Hits, from Chapter 3, goes on switched off. Under Shared Variables it gets a shorter flash, 0.05 seconds, and 18 hits for a bomb.

Its meter is Meter with Thresholds. Under Shared Variables, changeAmount, maximum and threshold are Expressions, as on the planes. Pick Expression in each Kind list, and type the card’s line into the box, quotes and all. The threshold’s reads mark.

That meter has one more Variable to fill this time. In Chapter 3 you left meterField empty, because a plane keeps its count to itself. The Sky Fortress doesn’t. Its meterField is a Text, so type hitsTaken into its Value, bare. Now the meter keeps its count in the hitsTaken field, where the health bar can read it.

Attach Sky Fortress Battle, and after it Patrol and Fortress Guns, each switched off. Under Shared Variables, pick Fortress Shell in shell’s list and Fighter in fighter’s. Last comes Cast Shadow, with its shadow and offsets.

Sinks When Shot Down, Enraged Fortress Guns and Calls Escorts come later in this chapter. Attach each when you make it. They’ll sit below Cast Shadow, not in the card’s order. That’s fine here. None of them needs another to go first.

ObjectSky Fortress
Transform
Bounding Box > SizeX 12, Y 12
Physics > Physics ObjectOff
Sprite
Scene Depth Draw Order18
SpriteSky Fortress Art
Transform > SizeX 12, Y 12
Collider
Shape and Transform > SizeX 10.625, Y 7.188
Tags and Interactions > InteractionsCollide Only With
Tags and Interactions > Collide Only WithTagged Fighter Round, Fighter
Data Structure
Data StructureEnemy Stats
Input SourceData Table
Data TableEnemy Types
Logic
Fly Down
Takes Hits(turned off)
Meter with Thresholds
Sky Fortress Battle
Sinks When Shot Down
Patrol(turned off)
Fortress Guns(turned off)
Enraged Fortress Guns(turned off)
Calls Escorts
Cast Shadow
Shared Variables
flashSeconds0.05
bombDamage18
changeAmount > KindExpression
changeAmount > ExpressionobjectComponentProperty("self","dataStruct","damage")
maximum > KindExpression
maximum > ExpressionobjectComponentProperty("self","dataStruct","health")
threshold > KindExpression
threshold > ExpressionobjectComponentProperty("self","dataStruct","mark")
meterFieldhitsTaken
shadowSky Fortress Shadow
offsetX1.406
offsetY-2.156
shellFortress Shell
fighterFighter
escortZero Fighter

9.5.9 Mission Timeline

The Mission Timeline gets one more row: Boss, the Sky Fortress, last of all. It comes a few seconds after the warning, at the top middle of the window, a little higher than the planes, since it’s bigger.

This time the new row is the file’s last row. So you can keep your table.

Download the new file from the card’s File line, the green one ending in ch09, and import it. The struck one is Chapter 8’s. Myth counts 1 new row. It lands at the end, where it belongs.

Data TableMission TimelineData Structure: Mission Timeline EntryAddDelete
IMPORT CSV55 rows, from a file
FIRST ROWS3 of 55, to compare
IMPORT CSV54 rows, from a file
FIRST ROWS3 of 54, to compare
Row 0Wave 1: V at 3 s
timeSeconds3
formationV
objectZero Fighter
x11.25
count5
spacing2.25
entryY35.9375
Row 1Wave 1: Column (left) at 6.5 s
timeSeconds6.5
formationColumn
objectZero Fighter
x5.3125
count4
spacing2.8125
entryY35.9375
Row 2Wave 1: Column (right) at 6.5 s
timeSeconds6.5
formationColumn
objectZero Fighter
x17.1875
count4
spacing2.8125
entryY35.9375

Now borrow the first V once more. In the first row, pick Sky Fortress in the object cell, and type 1 in its count. The last part of this chapter imports the file again, and that puts the row back.

Save, and run the game. At three seconds, the gray giant slides down from the top. It stops, and starts to sway. The rest of the mission still comes at its times, so the next planes of Wave 1 fly in around it.

A fan of pink shells sprays from its nose, and the wing guns fire at you. For now, your rounds fly straight through it. The next part makes them count.

9.6 Hits That Count

Now your rounds can hurt the giant, and it can hurt you back.

9.6.1 Breaks on Hit

Breaks on Hit breaks a round on any enemy plane. The Sky Fortress isn’t one, so it gets an Event of its own: When Starting to Hit Sky Fortress. It does the same three things, roundHit to the Sky Fortress, a spark, and the round removes itself.

Add a Collision Enter Event, and pick Sky Fortress in its Collision Target. Myth renames it. The first block’s Applies To is Other, under Event Context, as in the first Event.

Logic ComponentBreaks on HitAttach to: MG Round, Spread Round, Rapid RoundAddDelete

A round that hits an enemy tells it (roundHit) and breaks with a small spark.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
hitSparksCountNumberConstant6
When Starting to Hit Anything Tagged Enemy Aircraft
WhenCollision EnterObject: tag:Enemy Aircraft
1Trigger Custom Event on Object
Applies To
other
Custom Event
roundHit
2Burst Particles
Particles
"Hit Sparks"
Count
@self.hitSparksCount
Z Index Offset
2
3Destroy Instance
When Starting to Hit Sky Fortress
WhenCollision EnterObject: Sky Fortress
1Trigger Custom Event on Object
Applies To
other
Custom Event
roundHit
2Burst Particles
Particles
"Hit Sparks"
Count
@self.hitSparksCount
Z Index Offset
2
3Destroy Instance

9.6.2 The Three Rounds

Each of the Fighter’s rounds needs the Sky Fortress on its list too. Open the MG Round, the Spread Round and the Rapid Round, one by one, and add the Sky Fortress to Collide Only With, beside Tagged Enemy Aircraft. Each round’s Collider has its own list.

ObjectMG RoundAddDelete
Transform
Bounding Box > SizeX 3, Y 3
Sprite
Scene Depth Draw Order35
SpriteMG Round Art
Transform > SizeX 3, Y 3
Collider
CollisionSensor
Shape and Transform > SizeX 0.25, Y 0.75
Tags and Interactions > InteractionsCollide Only With
Tags and Interactions > Collide Only WithTagged Enemy Aircraft, Sky Fortress
Tags and Interactions > Collide Only WithTagged Enemy Aircraft
Tags
Object TagsFighter Round
Logic
Remove When Out of View
Breaks on Hit
ObjectSpread RoundAddDelete
Transform
Bounding Box > SizeX 3, Y 3
Sprite
Scene Depth Draw Order35
SpriteSpread Round Art
Transform > SizeX 3, Y 3
Collider
CollisionSensor
Shape and Transform > SizeX 0.375, Y 0.375
Tags and Interactions > InteractionsCollide Only With
Tags and Interactions > Collide Only WithTagged Enemy Aircraft, Sky Fortress
Tags and Interactions > Collide Only WithTagged Enemy Aircraft
Tags
Object TagsFighter Round
Logic
Remove When Out of View
Breaks on Hit
ObjectRapid RoundAddDelete
Transform
Bounding Box > SizeX 3, Y 3
Sprite
Scene Depth Draw Order35
SpriteRapid Round Art
Transform > SizeX 3, Y 3
Collider
CollisionSensor
Shape and Transform > SizeX 0.313, Y 0.813
Tags and Interactions > InteractionsCollide Only With
Tags and Interactions > Collide Only WithTagged Enemy Aircraft, Sky Fortress
Tags and Interactions > Collide Only WithTagged Enemy Aircraft
Tags
Object TagsFighter Round
Logic
Remove When Out of View
Breaks on Hit

9.6.3 Takes Hits

Takes Hits counts hits on every plane, and now on the Sky Fortress too. It gets one more step in each of its counting Events: right after changeMeter, Trigger Custom Event on Object sends hitCounted. It comes after. So the meter has already counted the hit when anyone hears of it.

Add each new block at the end of its Event’s line, and join it. A plane ignores hitCounted, because nothing on it listens. Only the Sky Fortress has Logic that does, its Sky Fortress Battle.

Logic ComponentTakes HitsAttach to: Zero Fighter, Red Ace, Dive Bomber, Heavy Bomber, Sky FortressAddDelete

Each Fighter round that hits counts roundDamage on the enemy's meter and flashes it white for a moment; a bomb counts bombDamage.

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
SHARED VARIABLES
NameTypeKindStarting Value
flashSecondsNumberConstant0.06
roundDamageNumberConstant1
bombDamageNumberConstant25
On Round Hit
WhenroundHitCustom Event
1Change Sprite Tint Property
2Change Sprite Tint Property
Property
Mode
Value
"solid"
3Change Sprite Tint Property
Property
Enabled
Value
true
4Start Recurring Timer
Timer Name
hitFlash
Repeat Every (s)
@self.flashSeconds
First Delay (s)
@self.flashSeconds
Ring Once
Yes
5Change Component Value
Component Value
self.enemyStats.damage
Value
@self.roundDamage
6Trigger Custom Event on Object
Custom Event
changeMeter
7Trigger Custom Event on Object
Custom Event
hitCounted
On the Hit Flash Timer
WhenRecurring TimerTimer name: hitFlash
1Change Sprite Tint Property
Property
Enabled
Value
false
On Bomb Dropped
WhenbombDroppedCustom Event
1Change Component Value
Component Value
self.enemyStats.damage
Value
@self.bombDamage
2Trigger Custom Event on Object
Custom Event
changeMeter
3Trigger Custom Event on Object
Custom Event
hitCounted

The card’s other changes are for the fall. They come in the part called Going down.

9.6.4 Show With Fortress

The health bar shows only while the Sky Fortress is in the sky. Show With Fortress shows its piece when fortressArrived comes, and hides it when fortressSunk comes. Nothing sends fortressSunk yet. Add it with Add Custom Event…, as for any message no one sends yet.

It has no Variables at all. Each Set Visible’s Visible is a list that starts on No, so pick Yes in the first, and leave the second.

Logic ComponentShow With FortressAttach to: Health Bar Frame, Health Bar Fill, Health Bar Name

Shows this health bar piece while the Sky Fortress is in the sky.

Attach toAny Object
On Fortress Arrived
WhenfortressArrivedCustom Event
1Set Visible
Visible
Yes
On Fortress Sunk
WhenfortressSunkCustom Event
1Set Visible
Visible
No

9.6.5 Fortress Health Fill

The bar’s fill is as wide as the Sky Fortress’s health left. Unhurt, it’s full. With half its health gone, it’s half as wide.

So when fortressDamaged comes, Fortress Health Fill works out how much is left as fill: one, take away the hits taken divided by the health. Then Set Scale makes the bar that wide, in Horizontal Scale. Vertical Scale stays 1, as it starts, so the bar keeps its height.

How does it know the hits? The message came from the Sky Fortress. In a formula, event() reads a value of the Object that sent it: event("hitsTaken") is the Sky Fortress’s hitsTaken, and event("health") its health. It’s the Event’s other, from Chapter 8, read in a formula.

It needs no Shared Variables. fill is made by the Event itself, a Declare Variable, a Number at 0, as secondsToPosition was. Type fill into Set Scale’s Horizontal Scale.

Logic ComponentFortress Health FillAttach to: Health Bar Fill

Keeps the health bar's fill as wide as the Sky Fortress's health left.

Attach toAny Object
On Fortress Damaged
WhenfortressDamagedCustom Event
1Declare Variable
Name
fill
Value
0
2Change Variable
Variable
fill
Value
1 - event("hitsTaken") / event("health")
3Set Scale
Horizontal Scale
fill

9.6.6 The Health Bar

The health bar is three pieces at the top of the window: a dark frame, a red fill inside it, and the words SKY FORTRESS above them. All three are on the screen, with Window / UI and Top Center, and each has Show With Fortress.

The frame is the Boss Bar Frame Art, 560 by 44 pixels. The fill is the Boss Bar Fill Art, 528 by 14, with Fortress Health Fill as well. Its picture is drawn from its left end, so it shrinks toward the left, like the Rapid Meter.

There’s nothing to set for that. The Boss Bar Fill Art comes from the Starter Kit that way.

The name is a Text / UI, in Bebas Neue, a pale pink.

ObjectHealth Bar Frame
Transform
Presentation > SpaceWindow / UI
Presentation > Screen AnchorTop Center
Presentation > Render LayerUI
Bounding Box > SizeX 128, Y 128
Sprite
Scene Depth Draw Order104
SpriteBoss Bar Frame Art
Transform > SizeX 560, Y 44
Logic
Show With Fortress
ObjectHealth Bar Fill
Transform
Presentation > SpaceWindow / UI
Presentation > Screen AnchorTop Center
Presentation > Render LayerUI
Bounding Box > SizeX 128, Y 128
Sprite
Scene Depth Draw Order105
SpriteBoss Bar Fill Art
Transform > SizeX 528, Y 14
Logic
Show With Fortress
Fortress Health Fill
ObjectHealth Bar Name
Transform
Presentation > SpaceWindow / UI
Presentation > Screen AnchorTop Center
Presentation > Render LayerUI
Bounding Box > SizeX 128, Y 48
Text / UI
TextSKY FORTRESS
FontBebas Neue
Font Size18
Color#FFD6C8
Letter Spacing1
AlignmentCenter
Text BoundsWrap to Width
Transform > Size X300
Logic
Show With Fortress

Place the three from PLACE THESE, hidden. The fill’s X is -264, half its width to the left of the middle, so the fill sits centered in the frame. The name gets its Z-Index of 106.

9.6.7 Hurt by Enemies

The Fighter shouldn’t fly through the giant either. Hurt by Enemies gets a third Collision Enter Event, with Sky Fortress in its Collision Target, and it calls Hurt the Fighter, like the other two.

Logic ComponentHurt by EnemiesAttach to: FighterAddDelete

An enemy round or an enemy plane (the Sky Fortress too) that touches the Fighter hurts it (Hurt the Fighter); it starts every mission protected.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
startProtectSecondsNumberConstant2
When Created
WhenCreate
1Start ProtectionFunction
caller
self
seconds
@self.startProtectSeconds
When Starting to Hit Anything Tagged Enemy Fire
WhenCollision EnterObject: tag:Enemy Fire
1Hurt the FighterFunction
caller
self
When Starting to Hit Anything Tagged Enemy Aircraft
WhenCollision EnterObject: tag:Enemy Aircraft
1Hurt the FighterFunction
caller
self
When Starting to Hit Sky Fortress
WhenCollision EnterObject: Sky Fortress
1Hurt the FighterFunction
caller
self

9.6.8 Fighter

The Fighter’s Collide Only With gets the Sky Fortress too, after Tagged Pickup. On its Changes card, that line shows twice, the new one green, the old one struck under it. The last green line, Stops When the Mission Is Won, comes in the part called Mission complete.

ObjectFighterAddDelete
Transform
Bounding Box > SizeX 3, Y 3
Physics > Physics ObjectOff
Sprite
Scene Depth Draw Order30
SpriteFighter Art
Transform > SizeX 3, Y 3
Collider
Shape and Transform > PositionX 0, Y -0.094
Shape and Transform > SizeX 0.656, Y 0.75
Tags and Interactions > InteractionsCollide Only With
Tags and Interactions > Collide Only WithTagged Enemy Aircraft, Tagged Enemy Fire, Tagged Pickup, Sky Fortress
Tags and Interactions > Collide Only WithTagged Enemy Aircraft, Tagged Enemy Fire, Tagged Pickup
Logic
Top-down Controls
Keep Inside Box
Fighter Guns
Hurt by Enemies
Protection Blink
Lost With the Last Medkit
Cast Shadow
Weapon Pickups
Drops Bombs
Stops When the Mission Is Won
Shared Variables
moveSpeed10.313
minimumX1.313
maximumX21.188
minimumY7.188
maximumY30
shadowFighter Shadow
offsetX0.844
offsetY-1.313
roundMG Round
spreadRoundSpread Round
rapidRoundRapid Round

Save, and run the game. The giant comes down, and the bar appears at the top, full. At first your rounds break on the Sky Fortress in sparks, and nothing more. Once it starts to sway, each hit flashes it white, and the red fill grows shorter, a little at a time. Fly into it, and it costs a medkit.

Its health is 420 hits, so the bar takes a long while to empty. Nothing happens at half yet, or when the bar is empty. That’s the next two parts. It’s a good place to stop for a break, if you’d like one.

9.7 Enraged

Now the giant gets angry.

9.7.1 Show Banner

When it’s enraged, THE FORTRESS IS ENRAGED! crosses the middle of the screen. That’s the wave banner again. Sky Fortress Battle will put the words in $banner, and send fortressEnraged. Show Banner hears it. It shows its piece for enragedSeconds, 2.2 seconds.

The card’s other change is for the win, like Mission Music’s. On Game State Changed gets a second Check Game State, missionComplete, dragged in second, and the If’s condition gets its || part. The banner hides when the mission is lost or won.

Make enragedSeconds, a Constant Shared Variable, under bannerSeconds. The new Event listens for fortressEnraged. Nothing sends it yet, so add it with Add Custom Event….

Logic ComponentShow BannerAttach to: Banner Strip, Banner TextAddDelete

Shows this banner piece for a moment when a wave starts, while the mission is being played.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
bannerSecondsNumberConstant2.6
enragedSecondsNumberConstant2.2
On Wave Started
WhenwaveStartedCustom Event
1Set Visible
Visible
Yes
2Start Recurring Timer
Timer Name
banner
Repeat Every (s)
@self.bannerSeconds
First Delay (s)
@self.bannerSeconds
Ring Once
Yes
On the Banner Timer
WhenRecurring TimerTimer name: banner
1Set Visible
Visible
No
On Game State Changed
WhenGame State Changed
1Check Game State
Action Name
missionFailed
Game State
Mission Failed
2IfmissionFailed.value == true
Then
2Check Game State
Action Name
missionComplete
Game State
Mission Complete
3IfmissionFailed.value == true || missionComplete.value == true
Then
4Set Visible
Visible
No
On Fortress Enraged
WhenfortressEnragedCustom Event
1Set Visible
Visible
Yes
2Start Recurring Timer
Timer Name
banner
Repeat Every (s)
@self.enragedSeconds
First Delay (s)
@self.enragedSeconds
Ring Once
Yes

9.7.2 Enraged Fortress Guns

Enraged Fortress Guns fires the second half of the fight. It has two guns.

The first fires a ring of 16 shells every 1.5 seconds, 22.5 degrees apart, all the way around. Each ring is turned 17 degrees further than the last, so the gaps never sit in the same place. ringAngle keeps the turn.

Here’s a small puzzle in Fire a Spread’s numbers. A fan’s arc runs from its first round to its last, not around to the first again. Between sixteen shells, 22.5 degrees apart, there are only fifteen gaps, so the arc is @self.ringStep * (@self.ringCount - 1). The sixteenth gap closes the circle.

Fire a Spread aims the middle of its fan along its direction. So the direction is ringAngle plus half the arc, and the first shell flies at ringAngle itself.

The second gun fires 3 shells from the nose every 0.7 seconds, 16 degrees across, aimed at the Fighter. That’s Aim Down at the Fighter again, named burstAim.

Build it like Fortress Guns: shell and fighter at None, then fourteen numbers, all Constants. Its ringAngle changes with every ring, so it lives in a Data Structure of the Logic’s own, as secondsPatrolled does. Press the + on Data Structures and choose New Data Structure, and Myth names it Enraged Fortress Guns Data. Give it one field, ringAngle, a Number at 0.

Logic ComponentEnraged Fortress GunsAttach to: Sky Fortress

While on (once the Sky Fortress is enraged), it fires Phase 2: turning rings of shells and aimed triples from its nose.

Attach toAny Object
DATA STRUCTURES
Enraged Fortress Guns Dataself.enragedFortressGunsData
SHARED VARIABLES
NameTypeKindStarting Value
shellObjectConstantNone
fighterObjectConstantNone
ringCountNumberConstant16
ringStepNumberConstant22.5
ringTurnNumberConstant17
ringSpeedNumberConstant5.938
ringGapNumberConstant1.5
ringYNumberConstant-0.313
burstCountNumberConstant3
burstArcNumberConstant16
burstSpeedNumberConstant10.313
burstGapNumberConstant0.7
noseYNumberConstant-5.063
aimMinNumberConstant200
aimMaxNumberConstant340
enemyMuzzleFlashCountNumberConstant5
When Enabled
WhenOn Enable
1Start Recurring Timer
Timer Name
ringGun
Repeat Every (s)
@self.ringGap
First Delay (s)
@self.ringGap
2Start Recurring Timer
Timer Name
burstGun
Repeat Every (s)
@self.burstGap
First Delay (s)
@self.burstGap
On the Ring Gun Timer
WhenRecurring TimerTimer name: ringGun
1Check Game State
Action Name
stillPlayingForRing
Game State
Playing
2IfstillPlayingForRing.value == true
Then
3Change Component Value
Component Value
self.enragedFortressGunsData.ringAngle
Operator
+=
Value
@self.ringTurn
4Fire a SpreadFunction
caller
self
round
@self.shell
count
@self.ringCount
direction
self.enragedFortressGunsData.ringAngle + @self.ringStep * (@self.ringCount - 1) / 2
arc
@self.ringStep * (@self.ringCount - 1)
speed
@self.ringSpeed
muzzleX
0
muzzleY
@self.ringY
5Burst Particles
Particles
"Enemy Muzzle Flash"
Y
@self.ringY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
6Control Sound
Sound
"Enemy Guns"
7Otherwise
8Stop Recurring Timer
Timer Name
ringGun
On the Burst Gun Timer
WhenRecurring TimerTimer name: burstGun
1Check Game State
Action Name
stillPlayingForBurst
Game State
Playing
2IfstillPlayingForBurst.value == true
Then
3Aim Down at the FighterFunction
Action Name
burstAim
caller
self
fighter
@self.fighter
aimMin
@self.aimMin
aimMax
@self.aimMax
4Fire a SpreadFunction
caller
self
round
@self.shell
count
@self.burstCount
direction
burstAim.value
arc
@self.burstArc
speed
@self.burstSpeed
muzzleX
0
muzzleY
@self.noseY
5Burst Particles
Particles
"Enemy Muzzle Flash"
Y
@self.noseY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
6Control Sound
Sound
"Enemy Guns"
7Otherwise
8Stop Recurring Timer
Timer Name
burstGun
When Disabled
WhenOn Disable
1Stop Recurring Timer
Timer Name
ringGun
2Stop Recurring Timer
Timer Name
burstGun

9.7.3 Calls Escorts

Once it’s enraged, the giant calls for help. Two Zero Fighters come down from above the top, one on each side, and two more every 6 seconds. They’re escorts, plain Zero Fighters that fly, fire and go down like any other.

Calls Escorts starts its escorts timer when fortressEnraged comes, first after 2 seconds. Each time it rings, while the mission is being played, two Create Instances make a Zero Fighter at leftX and at rightX. Once the mission is over, the Else stops the timer.

Its escort is an Object Shared Variable, a Constant, and its Starting Value stays at None. The Sky Fortress picks Zero Fighter. Each Create Instance picks @self.escort in Object to Create, among the Logic’s own Object Variables. Myth names the second one created2 by itself, in its Created As box, since the first is already created.

The card gives no Position Relative To, so leave it on World, as it starts. The card’s leftX and rightX are places in the sky, at the window’s two sides, not places on the giant.

Logic ComponentCalls EscortsAttach to: Sky Fortress

Once the Sky Fortress is enraged, two Zero Fighter escorts arrive above the top every escortGap seconds.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
escortObjectConstantNone
escortFirstNumberConstant2
escortGapNumberConstant6
leftXNumberConstant3.75
rightXNumberConstant18.75
entryYNumberConstant35.938
On Fortress Enraged
WhenfortressEnragedCustom Event
1Start Recurring Timer
Timer Name
escorts
Repeat Every (s)
@self.escortGap
First Delay (s)
@self.escortFirst
On the Escorts Timer
WhenRecurring TimerTimer name: escorts
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true
Then
3Create Instance
Object to Create
@self.escort
X
@self.leftX
Y
@self.entryY
4Create Instance
Object to Create
@self.escort
X
@self.rightX
Y
@self.entryY
Created As
created2
5Otherwise
6Stop Recurring Timer
Timer Name
escorts

9.7.4 Sky Fortress Battle: Enraged

Now Sky Fortress Battle’s fourth Event, On Meter Threshold Reached. Add it, and leave Any meter, as for Shot Down’s in Chapter 3.

It runs twice in a fight. The first time, at half health, the Sky Fortress is enraged. The second, at full, it goes down.

So the Event gets two Modes. Right-click its Mode 1, choose Rename Mode…, and name it Enraged. Then add Go Down with New Mode…. Its Modes stay on One at a time, and Enraged is the Starting Mode, as the card’s (Starting Mode) says. Go Down’s blocks come in the next part.

The Enraged Mode starts with the same question as the rest: is the mission still being played? Rounds still in the air after the Fighter is lost mustn’t enrage it. Then it moves the mark. Its meter’s mark was half its health. Now it’s all of it, so the next time the meter reaches mark, the Sky Fortress has nothing left.

After that, Switch Mode turns this Event to Go Down, so the second time runs that instead. The card has no Event line, so its Event list stays on Current Event. Its Mode list then holds this Event’s own two. Pick Go Down.

Then comes the show. The words go into $banner, from @self.enragedWords, the camera shakes, and a Big Explosion bursts with the Explosion Large. Last come the new orders. Fortress Guns goes off, with Disable in its State list, Enraged Fortress Guns goes on, and fortressEnraged goes out to the banner and the escorts.

Logic ComponentSky Fortress Battlecontinued
On Meter Threshold Reached
WhenMeter Threshold Reached
ModeEnraged (Starting Mode)
1Check Game State
Action Name
stillPlayingForEnrage
Game State
Playing
2IfstillPlayingForEnrage.value == true
Then
3Change Component Value
Component Value
self.enemyStats.mark
Value
self.enemyStats.health
4Switch Mode
Mode
Go Down
5Change Variable
Variable
$banner
Value
@self.enragedWords
6Camera Shake
Intensity
@self.enrageShakeStrength
Seconds
@self.enrageShakeSeconds
7Control Sound
Sound
"Explosion Large"
8Burst Particles
Particles
"Big Explosion"
Count
@self.enrageBigExplosionCount
Z Index Offset
2
9Set Logic State
Logic Component
"Fortress Guns"
State
Disable
10Set Logic State
Logic Component
"Enraged Fortress Guns"
11Trigger Custom Event
Custom Event
fortressEnraged

Attach Enraged Fortress Guns to the Sky Fortress, switched off. Its shell and fighter are picked already. They’re the same two Shared Variables Fortress Guns brought, so Myth Engine keeps your picks. Calls Escorts goes on too, switched on, since it does nothing until fortressEnraged comes. Under Shared Variables, pick Zero Fighter in escort’s list.

Halfway through 420 hits takes a while. For a quicker test, open Enemy Types and type 36 in the Sky Fortress’s health, the Heavy Bomber’s. Half of that is 18, a bomb’s worth.

Save, and run the game. When the giant has started to sway, press B. The camera shakes, a Big Explosion bursts, and THE FORTRESS IS ENRAGED! crosses the screen.

The fans stop. Rings of pink shells spin out instead, with triples from the nose. Two Zero Fighters come down at the sides, and two more after them.

Keep the 36 for now. The next two parts use it too.

9.8 Going Down

Now it falls.

9.8.1 Breaks on Bomb

When the Sky Fortress goes down, it clears the sky, as a bomb does. Breaks on Bomb gets a second Event, for fortressDown, with the same two blocks. Every enemy round in the sky breaks.

Go Down will send fortressDown, at the end of this part. Nothing sends it yet, so add it with Add Custom Event…. From then on it’s in the Add Event list, so the next two pieces pick it there.

Logic ComponentBreaks on BombAttach to: Enemy Round, Fortress ShellAddDelete

An enemy round breaks with a small spark when a bomb goes off or the Sky Fortress goes down.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
blastSparksCountNumberConstant4
On Bomb Dropped
WhenbombDroppedCustom Event
1Burst Particles
Particles
"Hit Sparks"
Count
@self.blastSparksCount
Z Index Offset
2
2Destroy Instance
On Fortress Down
WhenfortressDownCustom Event
1Burst Particles
Particles
"Hit Sparks"
Count
@self.blastSparksCount
Z Index Offset
2
2Destroy Instance

9.8.2 Takes Hits: The Fall

Every enemy plane hears fortressDown too. Takes Hits counts it as a bomb: bombDamage hits, so the escorts go down with their giant.

It also gets On Disable. Go Down switches Takes Hits off on the Sky Fortress. If the last hit’s white flash were still on, it would sink white. So On Disable switches the tint off at once, and it sinks in its own colors.

Logic ComponentTakes HitscontinuedAddDelete
On Fortress Down
WhenfortressDownCustom Event
1Change Component Value
Component Value
self.enemyStats.damage
Value
@self.bombDamage
2Trigger Custom Event on Object
Custom Event
changeMeter
3Trigger Custom Event on Object
Custom Event
hitCounted
When Disabled
WhenOn Disable
1Change Sprite Tint Property
Property
Enabled
Value
false

9.8.3 Sinks When Shot Down

The Sky Fortress doesn’t burst like a plane. It sinks, slowly, for 2.6 seconds, with small explosions bursting all over its back and wings. At the end it goes in one huge one.

When fortressDown comes, it starts sinking at sinkSpeed, with a long, gentle shake and the Explosion Large. Two timers start. The sinkBlast timer rings every 0.16 seconds, from the start, over and over. The sunk timer rings once.

Each sinkBlast picks a place on the giant at random. The blastX roll is a number from -@self.blastWidth to @self.blastWidth, and blastY one from -@self.blastHeight to @self.blastHeight. A Plane Explosion bursts there, with the Explosion Small. That’s a chain of small fires, all over its back.

When sunk rings, the chain stops. Everything else comes at once: one great explosion, smoke, the Explosion Boss, a cream-white flash and a heavier shake. The message fortressSunk tells the health bar and Game Rules. Last of all, it removes itself.

Its thirteen SHARED VARIABLES are all Constants. Type blastX and blastY over each Generate Random Number’s Action Name. Camera Flash’s Color is a swatch that starts white. Click it, and type the card’s cream, fff4d6, into its HEX box.

Logic ComponentSinks When Shot DownAttach to: Sky Fortress

When the Sky Fortress is shot down it sinks slowly with small explosions, then bursts, sends fortressSunk and is removed.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
sinkSpeedNumberConstant0.938
sinkSecondsNumberConstant2.6
blastGapNumberConstant0.16
blastWidthNumberConstant5.313
blastHeightNumberConstant3.438
goDownShakeStrengthNumberConstant0.02
goDownShakeSecondsNumberConstant2.8
planeExplosionCountNumberConstant30
sunkBigExplosionCountNumberConstant160
smokePuffCountNumberConstant30
sinkFlashSecondsNumberConstant0.5
sunkShakeStrengthNumberConstant0.04
sunkShakeSecondsNumberConstant0.9
On Fortress Down
WhenfortressDownCustom Event
1Set Velocity
X Velocity
0
Y Velocity
-@self.sinkSpeed
2Camera Shake
Intensity
@self.goDownShakeStrength
Seconds
@self.goDownShakeSeconds
3Control Sound
Sound
"Explosion Large"
4Start Recurring Timer
Timer Name
sinkBlast
Repeat Every (s)
@self.blastGap
First Delay (s)
0
5Start Recurring Timer
Timer Name
sunk
Repeat Every (s)
@self.sinkSeconds
First Delay (s)
@self.sinkSeconds
Ring Once
Yes
On the Sink Blast Timer
WhenRecurring TimerTimer name: sinkBlast
1Generate Random Number
Action Name
blastX
Minimum
-@self.blastWidth
Maximum
@self.blastWidth
2Generate Random Number
Action Name
blastY
Minimum
-@self.blastHeight
Maximum
@self.blastHeight
3Burst Particles
Particles
"Plane Explosion"
X
blastX.value
Y
blastY.value
Count
@self.planeExplosionCount
Z Index Offset
3
4Control Sound
Sound
"Explosion Small"
On the Sunk Timer
WhenRecurring TimerTimer name: sunk
1Stop Recurring Timer
Timer Name
sinkBlast
2Burst Particles
Particles
"Big Explosion"
Count
@self.sunkBigExplosionCount
Z Index Offset
4
3Burst Particles
Particles
"Smoke Puff"
Count
@self.smokePuffCount
Z Index Offset
2
4Control Sound
Sound
"Explosion Boss"
5Camera Flash
Color
#fff4d6
Seconds
@self.sinkFlashSeconds
6Camera Shake
Intensity
@self.sunkShakeStrength
Seconds
@self.sunkShakeSeconds
7Trigger Custom Event
Custom Event
fortressSunk
8Destroy Instance

Attach it to the Sky Fortress.

9.8.4 Sky Fortress Battle: Go Down

Back to Sky Fortress Battle, and its Go Down Mode. It has a line of its own, beside Enraged’s, so give it its blocks there. Each Set Logic State picks its Logic and Disable.

It asks the same question first. A mission already lost can’t be won by rounds still in the air. Next, it switches the fight off. It sends enemyShotDown, so Add Points adds its 25000 points, as for any plane. Last, fortressDown, for everything listening.

Logic ComponentSky Fortress Battlecontinued
On Meter Threshold Reached
WhenMeter Threshold Reached
ModeGo Down
1Check Game State
Action Name
stillPlayingForGoDown
Game State
Playing
2IfstillPlayingForGoDown.value == true
Then
3Set Logic State
Logic Component
"Takes Hits"
State
Disable
4Set Logic State
Logic Component
"Patrol"
State
Disable
5Set Logic State
Logic Component
"Enraged Fortress Guns"
State
Disable
6Set Logic State
Logic Component
"Calls Escorts"
State
Disable
7Trigger Custom Event
Custom Event
enemyShotDown
8Trigger Custom Event
Custom Event
fortressDown

Save, and run the game. Drop a bomb on the giant when it starts to sway. Wait. After the rings begin, wait for the first two escorts, and drop the second. It shakes, its escorts burst into smoke, and every shell in the sky breaks.

The score jumps by 25000. Then it sinks slowly, with small fires all over its back, and goes in a huge cream-white flash. The health bar vanishes with it.

After that, the mission goes on. The waves still come at their times, since you borrowed only the first row, but nothing ends the mission yet. Winning it is the last part.

9.9 Mission Complete

Now the mission can be won.

9.9.1 Mission Complete

Game Rules decides when the mission is lost, in Lose a Medkit, from Chapter 4. Now it decides when it’s won, in Mission Complete. When fortressSunk comes, and the mission is still being played, Set Game State picks Mission Complete.

That’s all it does. Everything else about the win answers the Game State, the way everything about a loss already does.

Logic ComponentMission CompleteAttach to: Game Rules

Wins the mission when the Sky Fortress has sunk, if the mission is still being played.

Attach toAny Object
On Fortress Sunk
WhenfortressSunkCustom Event
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true
Then
3Set Game State
Game State
Mission Complete

9.9.2 Stops When the Mission Is Won

When the mission is won, the Fighter stands down. It stops where it is, and it no longer flies, fires, drops bombs or can be hurt.

Stops When the Mission Is Won does it on the Fighter itself, as Lost With the Last Medkit does for a loss. It switches off the Fighter’s own Logic, one Set Logic State each, and Set Velocity stops it where it is.

It needs no Variables. Pick each Logic in its Set Logic State’s list, with Disable. Set Velocity’s two boxes start empty, so type 0 in both. Attach it to the Fighter.

Logic ComponentStops When the Mission Is WonAttach to: Fighter

When the mission is won the Fighter stops: it no longer flies, fires, drops bombs or can be hurt.

Attach toAny Object
On Game State Changed
WhenGame State Changed
1Check Game State
Action Name
missionComplete
Game State
Mission Complete
2IfmissionComplete.value == true
Then
3Set Logic State
Logic Component
"Top-down Controls"
State
Disable
4Set Logic State
Logic Component
"Fighter Guns"
State
Disable
5Set Logic State
Logic Component
"Hurt by Enemies"
State
Disable
6Set Logic State
Logic Component
"Drops Bombs"
State
Disable
7Set Velocity
X Velocity
0
Y Velocity
0

9.9.3 Mission Over

In Chapter 4, Mission Failed brought up the result screen after a loss. Now it does both endings. So it gets a name that fits both: Mission Over.

Rename it. Right-click Mission Failed in the Resources, and choose its Rename line. A box opens in its row, so type Mission Over there, and press Enter. It stays on Game Rules, in its place.

That’s what the Set up card’s REMOVED line means here: the old name goes, and the piece stays. It’s also the green line on Game Rules’ card.

Now make it match its card. Its card shows the whole piece, not its changes, because its name is new. So nothing on it is struck.

In short: two old blocks go, Start Recurring Timer and Set Logic State. Everything else of yours stays. Its Description changes too, so type the card’s over the old one.

Its new Shared Variable is victorySeconds, a Constant, 3. On Game State Changed gets a second Check Game State, missionComplete, dragged in second, and its If’s condition gets its || part, as in Mission Music and Show Banner.

Inside the If, the screen waits 2.4 seconds after a loss, and 3 after a win, a little longer to watch the giant go. Its Start Recurring Timer now sits in a new If, with an Else. So delete it. Add the new If with the outer If’s Add inside Then, and its own Add inside Then gives the True line a Start Recurring Timer. Add Else and Add inside Else give the Else line the other.

On the Result Screen Timer changes too. FLY AGAIN switches on only after a loss. Delete Set Logic State, and add three blocks at the end of the line. First comes Check Game State with Mission Failed, named endedInFailure. After it comes an If, and on its True line, Set Logic State with Fly Again picked.

Logic ComponentMission OverAttach to: Game Rules

When the mission ends, the result screen shows a moment later (resultSeconds after a loss, victorySeconds after a win); after a loss FLY AGAIN switches on.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
resultSecondsNumberConstant2.4
victorySecondsNumberConstant3
On Game State Changed
WhenGame State Changed
1Check Game State
Action Name
missionFailed
Game State
Mission Failed
2Check Game State
Action Name
missionComplete
Game State
Mission Complete
3IfmissionFailed.value == true || missionComplete.value == true
Then
4IfmissionFailed.value == true
Then
5Start Recurring Timer
Timer Name
resultScreen
First Delay (s)
@self.resultSeconds
Ring Once
Yes
6Otherwise
7Start Recurring Timer
Timer Name
resultScreen
First Delay (s)
@self.victorySeconds
Ring Once
Yes
On the Result Screen Timer
WhenRecurring TimerTimer name: resultScreen
1Trigger Custom Event
Custom Event
showResults
2Check Game State
Action Name
endedInFailure
Game State
Mission Failed
3IfendedInFailure.value == true
Then
4Set Logic State
Logic Component
"Fly Again"

9.9.4 High Score

High Score keeps a better score after a loss. Now after a win too. Its change is the same as Mission Music’s: a second Check Game State, missionComplete, dragged in second, and the If’s condition with its || part.

Logic ComponentHigh ScoreAttach to: Game RulesAddDelete

Reads the high score from this device when a mission starts, and saves a better score when the mission ends.

Attach toAny Object
When the Scene Starts
WhenScene Start
1Load Persistent Value
Action Name
savedHighScore
Key
"highScore"
Default
0
2Change Variable
Variable
$highScore
Value
savedHighScore.value
On Game State Changed
WhenGame State Changed
1Check Game State
Action Name
missionFailed
Game State
Mission Failed
2IfmissionFailed.value == true
Then
2Check Game State
Action Name
missionComplete
Game State
Mission Complete
3IfmissionFailed.value == true || missionComplete.value == true
Then
4If$score > $highScore
Then
5Change Variable
Variable
$highScore
Value
$score
6Save Persistent Value
Action Name
persistentWriteResult
Key
"highScore"
Value
$highScore

9.9.5 Show With Results

The result screen of a won mission has pieces of its own: MISSION COMPLETE: THE SKY FORTRESS HAS FALLEN, and RETURN TO BASE with its Enter key. In Chapter 4 you gave every result piece a state, and said they’d come in this chapter. Here they are.

Some pieces belong to both endings, though: the veil, FINAL SCORE and HIGH SCORE. So Show With Results gets one more PER INSTANCE VARIABLE, anyEnding. A piece with anyEnding Yes shows whatever the ending.

Press the + on Per Instance Variables, and pick Boolean in the Type list. Its Starting Value becomes a list, already at No.

The If’s condition changes. Now it asks self.anyEnding == true first, and then, after the ||, what it used to ask, stateMatches.value == true.

On the card, step 2 is struck, and a green step 2 stands under it. That’s how a card draws an If whose condition changed. Set Alpha and Set Visible, steps 3 and 4, aren’t marked, so they stay as they are.

So don’t delete the If. Deleting it would take those two blocks along. Click its box instead, and type the card’s whole condition over the old one.

Logic ComponentShow With ResultsAttach to: Result Veil, Game Over Banner, Final Score, Result High Score, Fly Again Key, Fly Again Prompt, Mission Complete Banner, Return Key, Return PromptAddDelete

Shows this result screen piece when Game Rules sends showResults, if the Game State is the piece's own (or for any ending, with anyEnding Yes).

Attach toAny Object
PER INSTANCE VARIABLES
NameTypeStarting Value
stateTextmission-failed
opacityNumber1
anyEndingBooleanNo
On Show Results
WhenshowResultsCustom Event
1Check Game State
Action Name
stateMatches
Game State
self.state
2IfstateMatches.value == true
Then
2Ifself.anyEnding == true || stateMatches.value == true
Then
3Set Alpha
Alpha
self.opacity
4Set Visible
Visible
Yes

9.9.6 The Won Mission’s Screen

The Mission Complete Banner is a blue banner, with MISSION COMPLETE in gold and THE SKY FORTRESS HAS FALLEN under it. The Return Key is the Enter key’s picture, and the Return Prompt is the words RETURN TO BASE in pale blue. All three are on the screen, with Window / UI and Center, and each has Show With Results.

You built their twins in Chapter 4. Duplicate each one, and the copy brings Show With Results along.

A copy of the Game Over Banner needs its name and the Mission Complete Banner Art. Its size, 640 by 170, and its Draw Order, 141, are already the Game Over Banner’s, so they need nothing. A copy of the Fly Again Key needs only its name, Return Key. A copy of the Fly Again Prompt needs its name, RETURN TO BASE in its Text, and a Size X of 165. Its pale blue Color is the Fly Again Prompt’s already.

ObjectMission Complete Banner
Transform
Presentation > SpaceWindow / UI
Presentation > Screen AnchorCenter
Presentation > Render LayerUI
Bounding Box > SizeX 128, Y 128
Sprite
Scene Depth Draw Order141
SpriteMission Complete Banner Art
Transform > SizeX 640, Y 170
Logic
Show With Results
ObjectReturn Key
Transform
Presentation > SpaceWindow / UI
Presentation > Screen AnchorCenter
Presentation > Render LayerUI
Bounding Box > SizeX 128, Y 128
Sprite
Scene Depth Draw Order142
SpriteKey Enter Icon
Transform > SizeX 72, Y 36
Logic
Show With Results
ObjectReturn Prompt
Transform
Presentation > SpaceWindow / UI
Presentation > Screen AnchorCenter
Presentation > Render LayerUI
Bounding Box > SizeX 128, Y 48
Text / UI
TextRETURN TO BASE
FontBebas Neue
Font Size28
Color#BCD7E8
Letter Spacing1
AlignmentCenter
Text BoundsWrap to Width
Transform > Size X165
Logic
Show With Results

Place the three from PLACE THESE, hidden. In Show With Results’ section of each placement’s Logic, type mission-complete into the State box, with no quotes. That’s how Myth stores the Game State Mission Complete. The Return Prompt’s Z-Index is 142.

Now for CHANGE THESE PLACEMENTS. Select the Result Veil, Final Score and Result High Score in the Scene, one by one. In the same section, each has an Any Ending switch now, reading No. Switch it on, so it reads Yes.

The veil’s line gives its Opacity too, the 0.6 you typed in Chapter 4. It doesn’t change.

The Game Over Banner and the FLY AGAIN pieces keep anyEnding off. They belong to a lost mission only.

9.9.7 Game Rules

Here’s Game Rules now. Mission Over is where Mission Failed was, and Mission Complete is new, at the bottom.

ObjectGame RulesAddDelete
Transform
Bounding Box > SizeX 3, Y 3
Data Structure
From LogicRun Mission Timeline
Data StructureRun Mission Timeline Data
Logic
Add Points
Run Mission Timeline
Lose a Medkit
Lose a Gun Level
Mission Start
Mission Clock
High Score
Mission Music
Mission Over
Mission Failed
Fly Again(turned off)
Run Waves
Pickup Rewards
Spend a Bomb
Mission Complete

Save, and run the game, with the borrowed row and the test health still in.

Bring the giant down with your two bombs. It sinks and goes in its cream-white flash, and the Boss Theme gives way to the Victory Jingle. The Fighter stops where it is. Space does nothing. Three seconds later, the screen darkens, and the blue banner says MISSION COMPLETE: THE SKY FORTRESS HAS FALLEN, over your final score and the high score.

RETURN TO BASE waits under it, with its Enter key. Press Enter, and nothing happens yet. In Chapter 10 it takes you back to the Main Menu.

9.10 The Whole Mission

Now put the mission back.

Open Enemy Types, and type 420 in the Sky Fortress’s health again. Then import the Mission Timeline’s file once more, and Myth puts the first row back as the file has it, five Zero Fighters in a V.

Save, and run the game. Fly the whole mission. Four waves, then the warning, and the Sky Fortress. It’s the longest fight in the game, so take your time.

Play it!

Watch for each of these.

  • At 112 seconds of mission time, STAGE says BOSS. No wave banner comes. WARNING blinks instead, with the siren, and the Boss Theme replaces the Battle Theme.
  • A few seconds later, the gray giant comes down the middle, and the SKY FORTRESS bar appears at the top, full.
  • While it comes down, your rounds break on it in sparks, and the bar doesn’t move.
  • Once it stops and sways, each hit flashes it white, and the red fill shortens. A bomb takes a bigger bite.
  • It fires fans of 7 pink shells from its nose, and single shells from each wing at you.
  • Fly into it, and it costs a medkit, as any enemy plane would.
  • At half, the camera shakes. THE FORTRESS IS ENRAGED! crosses the screen. Rings of 16 shells spin out, turning a little each time, with triples from the nose.
  • Two Zero Fighter escorts come down at the sides, then two more every 6 seconds.
  • When the bar is empty, every shell in the sky breaks, the escorts go down, and the score jumps by 25000. The giant sinks in a chain of small explosions, and goes in a cream-white flash.
  • The Victory Jingle plays, the Fighter stops, and 3 seconds later the screen says MISSION COMPLETE: THE SKY FORTRESS HAS FALLEN, with RETURN TO BASE.
  • Lose instead, and it’s GAME OVER, as before, with FLY AGAIN.
How it works

The Sky Fortress arrives with all its Logic, most of it switched off. It comes down untouchable. In place, it switches on its patrol, its guns and its hits. At half, one Mode swaps its guns and calls its escorts, and turns the Event to its other Mode. At full, the other switches everything off and sinks it.

The meter only counts. Sky Fortress Battle gives the orders.

Underneath is one idea, which you met in Chapter 4 with Fly Again: a Logic Component that’s off answers nothing. Switching pieces on and off, at the right moments, gives one Object a fight with a beginning, a middle and an end. No piece checks which part of the fight it’s in. Each one does its job while it’s on, and waits while it’s off.

9.11 If It Didn’t Work

Something may be a little off the first time. That’s normal. This is a long chapter with many orders, so run the game, find the piece that misbehaves, and watch what it does.

No WARNING, and no siren? Look at the Waves table: the Boss row’s warning switch should be On. Then in Run Waves, the new If’s condition is data("Waves", self.runWavesData.nextWave, "warning") == true, on the outer If’s True line, right after the banner’s Change Variable. Last, Blink Warning should be on the Warning Banner, with fortressWarning spelled the same in both.

The WARNING shows but never blinks, or never goes? Blink’s switch on the Warning Banner should be gray, off, at the start. Blink Warning’s first Set Logic State says Enable, and its second says Disable.

The music never turns? Look for On Fortress Warning in Mission Music.

Each wave comes, but with no banner at all? Perhaps the old Trigger Custom Event went, but the new one never came back. Its Else should send waveStarted.

The Sky Fortress never comes? Is the Boss row in the Mission Timeline, with Sky Fortress in its object cell? If the cell says missing, the Object didn’t exist yet when you imported. Pick Sky Fortress in it.

It comes down, but keeps going, out of the window? Look at Sky Fortress Battle’s first Event. Its Start Recurring Timer and Trigger Custom Event belong on the main line, after the If. After that, look at its second Event, which switches Patrol on.

It stops, but never fires? Fortress Guns should be attached, switched off, and the Sky Fortress’s Shared Variables should pick Fortress Shell and Fighter. Sky Fortress Battle should switch it on.

Your rounds fly through it, even once it sways? Each of the three rounds needs the Sky Fortress in its Collide Only With, and the Sky Fortress needs Tagged Fighter Round in its own. And Breaks on Hit needs its second Event, When Starting to Hit Sky Fortress.

It flashes white, but the bar never moves? Look at meterField under the Sky Fortress’s Shared Variables. It should say hitsTaken, bare. Takes Hits should send hitCounted after changeMeter, in each Event.

The bar starts empty and grows? Fortress Health Fill’s formula is 1 - event("hitsTaken") / event("health"), with the 1 first.

Half its health goes, and nothing happens? Look at threshold under the Sky Fortress’s Shared Variables, which should be an Expression that reads mark. Next, look at Sky Fortress Battle’s first Change Component Value, which sets mark to half the health.

It’s enraged again and again, and never goes down? Switch Mode in Enraged should pick Go Down, and the Event’s Modes should stay One at a time.

The bar empties, and it flies on? Go Down’s last step sends fortressDown. Sinks When Shot Down should be attached to the Sky Fortress.

It sinks white? Takes Hits’ On Disable should switch the tint off, with Enabled false.

It goes, but the mission never ends? Mission Complete should be on Game Rules, listening for fortressSunk. Sinks When Shot Down sends it, right before it removes itself.

FLY AGAIN shows after a win? In Mission Over, Set Logic State belongs inside the new If, after Check Game State asks for Mission Failed.

The veil or the scores are missing from the won screen? Their placements need Any Ending switched on.

The giant goes down in a few hits? Enemy Types’ Sky Fortress row should say 420 again, not the test’s 36.

The game won’t start? Myth says Can’t run yet, and its message names the Logic Component that’s wrong. Open it, and the Errors bar under the canvas says which block. Count the quotes.

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.

Challenge

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 chapter’s project stays as it was. Or start Chapter 10 from this chapter’s catch-up download.

Now give the giant a third way to fight. Move its first mark to a third of its health, and the second to two thirds.

Add a third Mode, and a gun of your own to switch on there. Faster rings? A spiral? Shells aimed at where the Fighter is going?

Or make a giant of your own, with its own picture borrowed for now. What would it do when it’s angry?

Still stuck? Search the manual, or ask in the Myth Engine Discord (opens a new tab).

Your mission can be won now, and lost. In Chapter 10, Sky Ace gets its front door, a title screen with a menu.