Build a GameCreating Sky Ace

Appendix A — Logic Reference

Every Logic Component and Function in Sky Ace, as it is in the finished game. Each entry stands on its own: read what it does, see what it needs, and build it from its card into your own game. A card’s Shared Variables and Per Instance Variables are the values you can change. A Shared Variable holds one value for the whole Object, under Variables in its Properties. A Per Instance Variable holds one for each placement in the Scene.

A.1 Keep Inside Box

Comes whole from Myth’s templates. Built in Chapter 1, The Fighter Flies.

Logic ComponentKeep Inside BoxAttach to: Fighter

Clamps an instance to an authored rectangular play area every Step.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
minimumXNumberConstant0
maximumXNumberConstant25
minimumYNumberConstant0
maximumYNumberConstant18.75
Built in: this Logic Component comes whole from the engine's template.
You add it and set its Variables on the Object; you do not build its Events.

A.2 Top-Down Controls

Comes whole from Myth’s templates. Built in Chapter 1, The Fighter Flies.

Logic ComponentTop-down ControlsAttach to: Fighter

Rebindable four-way movement assembled around one focused 2D Axis velocity primitive.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
moveSpeedNumberConstant6.875
Built in: this Logic Component comes whole from the engine's template.
You add it and set its Variables on the Object; you do not build its Events.

A.3 Fighter Guns

Built in Chapter 2, Machine Guns.

Logic ComponentFighter GunsAttach to: Fighter

While Fire is held, fires the current weapon each time its cooldown is over: Machine Guns, Spread Shot or Rapid Guns (one Mode each).

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
roundObjectConstantNone
roundSpeedNumberConstant32.813
fireRateSecondsNumberConstant0.11
spreadRoundObjectConstantNone
spreadSpeedNumberConstant25.625
spreadRateSecondsNumberConstant0.17
spreadArcPerLevelNumberConstant20
spreadMuzzleYNumberConstant1.25
rapidRoundObjectConstantNone
rapidRateSecondsNumberConstant0.061
While Fire Is Held
WhenCommand HeldCommand: Fire
ModeMachine Guns (Starting Mode)
1Check Cooldown Ready
Action Name
machineGunsReady
Cooldown Key
fireRate
2IfmachineGunsReady.value == true
Then
3Start Cooldown
Cooldown Key
fireRate
Seconds
@self.fireRateSeconds
4Sound the GunsFunction
caller
self
5Fire a VolleyFunction
caller
self
round
@self.round
speed
@self.roundSpeed
While Fire Is Held
WhenCommand HeldCommand: Fire
ModeSpread Shot
1Check Cooldown Ready
Action Name
spreadShotReady
Cooldown Key
fireRate
2IfspreadShotReady.value == true
Then
3Start Cooldown
Cooldown Key
fireRate
Seconds
@self.spreadRateSeconds
4Sound the GunsFunction
caller
self
5Fire a SpreadFunction
caller
self
round
@self.spreadRound
count
1 + 2 * $gunLevel
direction
90
arc
@self.spreadArcPerLevel * $gunLevel
speed
@self.spreadSpeed
muzzleX
0
muzzleY
@self.spreadMuzzleY
While Fire Is Held
WhenCommand HeldCommand: Fire
ModeRapid Guns
1Check Cooldown Ready
Action Name
rapidGunsReady
Cooldown Key
fireRate
2IfrapidGunsReady.value == true
Then
3Start Cooldown
Cooldown Key
fireRate
Seconds
@self.rapidRateSeconds
4Sound the GunsFunction
caller
self
5Fire a VolleyFunction
caller
self
round
@self.rapidRound
speed
@self.roundSpeed

A.4 Fire a Volley (Function)

Built in Chapter 2, Machine Guns.

FunctionFire a Volley

Fires one machine-gun volley: a round for each Gun Patterns row of the current gun level, at that row's place and direction.

PARAMETERS
NameTypeStarts at
CallerObject
roundObjectStructural
Required Components
Slot Nametransform
Component TypeTransform
speedNumber32.813
ACTIONS
1RepeatdataCount("Gun Patterns")times
Each time
2Ifdata("Gun Patterns", local.index, "gunLevel") == $gunLevel
Then
3Create Instance
Applies To
Caller
Object to Create
round
Position Relative To
Self
X
data("Gun Patterns", local.index, "offsetX")
Y
data("Gun Patterns", local.index, "offsetY")
4Set Direction
Applies To
created
Direction
data("Gun Patterns", local.index, "direction")
5Set Speed
Applies To
created
Speed
speed

A.5 Remove When Out of View

Built in Chapter 2, Machine Guns.

Logic ComponentRemove When Out of ViewAttach to: MG Round, Zero Fighter, Enemy Round, Red Ace, Dive Bomber, Heavy Bomber, Power Up Pickup, Spread Shot Pickup, Rapid Guns Pickup, Bomb Crate Pickup, Medkit Pickup, Spread Round, Rapid Round, Fortress Shell

Removes this Object once it has left the view, so nothing that has flown away keeps costing time.

Attach toAny Object
When Leaving the View
WhenLeave View
1Destroy Instance

A.6 Show Gun Level

Built in Chapter 2, Machine Guns.

Logic ComponentShow Gun LevelAttach to: Power Pip

Shows this power pip while the gun level is at least its level (1 to 4).

Attach toAny Object
PER INSTANCE VARIABLES
NameTypeStarting Value
levelNumber1
When Created
WhenCreate
1Show If At LeastFunction
caller
self
level
self.level
value
$gunLevel
On Variable Changed · Gun Level
WhenVariable ChangedGlobal Variable: gunLevel
1Show If At LeastFunction
caller
self
level
self.level
value
$gunLevel

A.7 Add Points

Built in Chapter 3, Enemy Fighters.

Logic ComponentAdd PointsAttach to: Game Rules

Adds the points of every enemy shot down to the score, while the mission is being played.

Attach toAny Object
On Enemy Shot Down
WhenenemyShotDownCustom Event
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true
Then
3Change Variable
Variable
$score
Operator
+=
Value
event("points")

A.8 Breaks on Hit

Built in Chapter 3, Enemy Fighters.

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

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

A.9 Fly Down

Built in Chapter 3, Enemy Fighters.

Logic ComponentFly DownAttach to: Zero Fighter, Red Ace, Dive Bomber, Heavy Bomber, Sky Fortress

Flies straight down the screen at the speed in its Enemy Stats.

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
When Created
WhenCreate
1Set Direction
Direction
270
2Set Speed
Speed
self.enemyStats.speed

A.10 Meter with Thresholds

Comes whole from Myth’s templates. Built in Chapter 3, Enemy Fighters.

Logic ComponentMeter with ThresholdsAttach to: Zero Fighter, Red Ace, Dive Bomber, Heavy Bomber, Sky Fortress

Owns a bounded meter update entry point and publishes its threshold crossings as Events.

Attach toAny Object
DATA STRUCTURES
Meter with Thresholds Dataself.meterWithThresholdsData
SHARED VARIABLES
NameTypeKindStarting Value
changeAmountNumberConstant1
minimumNumberConstant0
maximumNumberConstant100
thresholdNumberConstant100
meterFieldTextConstant(empty)
Built in: this Logic Component comes whole from the engine's template.
You add it and set its Variables on the Object; you do not build its Events.

A.11 Run Mission Timeline

Built in Chapter 3, Enemy Fighters.

Logic ComponentRun Mission TimelineAttach to: Game Rules

Runs the Mission Timeline: each row's formation arrives at its mission time, in order.

Attach toAny Object
DATA STRUCTURES
Run Mission Timeline Dataself.runMissionTimelineData
When Created
WhenCreate
1Start Recurring Timer
Timer Name
timeline
First Delay (s)
data("Mission Timeline", self.runMissionTimelineData.nextRow, "timeSeconds") - $missionTime
Ring Once
Yes
On the Timeline Timer
WhenRecurring TimerTimer name: timeline
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true
Then
3Whileself.runMissionTimelineData.nextRow < dataCount("Mission Timeline") && data("Mission Timeline", self.runMissionTimelineData.nextRow, "timeSeconds") <= $missionTime
Each time
4Make a Row ArriveFunction
caller
self
row
self.runMissionTimelineData.nextRow
5Change Component Value
Component Value
self.runMissionTimelineData.nextRow
Operator
+=
Value
1
6Ifself.runMissionTimelineData.nextRow < dataCount("Mission Timeline")
Then
7Start Recurring Timer
Timer Name
timeline
First Delay (s)
data("Mission Timeline", self.runMissionTimelineData.nextRow, "timeSeconds") - $missionTime
Ring Once
Yes

A.12 Shot Down

Built in Chapter 3, Enemy Fighters.

Logic ComponentShot DownAttach to: Zero Fighter, Red Ace, Dive Bomber, Heavy Bomber

When this enemy has taken as many hits as its health it tells Game Rules (enemyShotDown) and its own Logic (shotDown), explodes and is removed.

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
SHARED VARIABLES
NameTypeKindStarting Value
bigExplosionCountNumberConstant70
bigSmokeCountNumberConstant16
shakeStrengthNumberConstant0.012
shakeSecondsNumberConstant0.35
explosionCountNumberConstant36
smokeCountNumberConstant8
On Meter Threshold Reached
WhenMeter Threshold Reached
1Trigger Custom Event
Custom Event
enemyShotDown
2Trigger Custom Event on Object
Custom Event
shotDown
3Ifself.enemyStats.bigExplosion == true
Then
4Burst Particles
Particles
"Big Explosion"
Count
@self.bigExplosionCount
Z Index Offset
2
5Burst Particles
Particles
"Smoke Puff"
Count
@self.bigSmokeCount
Z Index Offset
2
6Control Sound
Sound
"Explosion Large"
7Camera Shake
Intensity
@self.shakeStrength
Seconds
@self.shakeSeconds
8Otherwise
9Burst Particles
Particles
"Plane Explosion"
Count
@self.explosionCount
Z Index Offset
2
10Burst Particles
Particles
"Smoke Puff"
Count
@self.smokeCount
Z Index Offset
2
11Control Sound
Sound
"Explosion Small"
12Destroy Instance

A.13 Spawn V Formation (Function)

Built in Chapter 3, Enemy Fighters.

FunctionSpawn V Formation

Creates a V of enemies above the top edge, centered on x, with its middle plane lowest.

PARAMETERS
NameTypeStarts at
CallerObject
enemyThing Object
xNumber11.25
countNumber5
spacingNumber2.25
entryYNumber35.938
rowStepNumber1.719
ACTIONS
1Repeatcounttimes
Each time
2Create Instance
Applies To
Caller
Object to Create
enemy
X
x + (local.index - (count - 1) / 2) * spacing
Y
entryY + abs(local.index - (count - 1) / 2) * rowStep

A.14 Takes Hits

Built in Chapter 3, Enemy Fighters.

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

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
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

A.15 Aim Down at the Fighter (Function)

Built in Chapter 4, Mission Failed.

FunctionAim Down at the Fighter

The direction from the caller to the Fighter in degrees, kept between aimMin and aimMax (downward only), or straight down (270) when the Fighter is not below.

PARAMETERS
NameTypeStarts at
CallerObject
fighterObjectStructural
Required Components
Slot Nametransform
Component TypeTransform
aimMinNumber200
aimMaxNumber340
RETURN TYPENumber
ACTIONS
1Declare Variable
Name
across
Value
0
2Declare Variable
Name
up
Value
0
3Declare Variable
Name
aim
Value
0
4Iffighter.transform.position.y < Caller.transform.position.y
Then
5Change Variable
Variable
across
Value
fighter.transform.position.x - Caller.transform.position.x
6Change Variable
Variable
up
Value
fighter.transform.position.y - Caller.transform.position.y
7Change Variable
Variable
aim
Value
radtodeg(atan2(up, across)) + 360
8Ifaim < aimMin
Then
9Change Variable
Variable
aim
Value
aimMin
10Ifaim > aimMax
Then
11Change Variable
Variable
aim
Value
aimMax
12Otherwise
13Change Variable
Variable
aim
Value
270
14Return
Value
aim

A.16 Breaks on Fighter

Built in Chapter 4, Mission Failed.

Logic ComponentBreaks on FighterAttach to: Enemy Round, Fortress Shell

An enemy round that hits the Fighter breaks with a small spark.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
hitSparksCountNumberConstant6
When Starting to Hit Fighter
WhenCollision EnterObject: Fighter
1Burst Particles
Particles
"Hit Sparks"
Count
@self.hitSparksCount
Z Index Offset
2
2Destroy Instance

A.17 Fly Again

Built in Chapter 4, Mission Failed.

Logic ComponentFly AgainAttach to: Game Rules

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).

Attach toAny Object
When Confirm Is Pressed
WhenCommand PressedCommand: Confirm
1Start a New MissionFunction
caller
self
When Fire Is Pressed
WhenCommand PressedCommand: Fire
1Start a New MissionFunction
caller
self
When Pause Is Pressed
WhenCommand PressedCommand: Pause
1Back to the Main MenuFunction

A.18 High Score

Built in Chapter 4, Mission Failed.

Logic ComponentHigh ScoreAttach to: Game Rules, Title Controls, Menu Controls

Reads the high score from this device when a Scene 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
2Check Game State
Action Name
missionComplete
Game State
Mission Complete
3IfmissionFailed.value == true || missionComplete.value == true
Then
4Keep a Better ScoreFunction
On Mission Quit
WhenmissionQuitCustom Event
1Keep a Better ScoreFunction

A.19 Hurt by Enemies

Built in Chapter 4, Mission Failed.

Logic ComponentHurt by EnemiesAttach to: Fighter

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

A.20 Hurt the Fighter (Function)

Built in Chapter 4, Mission Failed.

FunctionHurt the Fighter

What happens when an enemy round or plane hits the Fighter: unless it is protected, it is protected for a while, the hit is seen and heard, and fighterHit tells Game Rules (a medkit and a gun level are lost there).

PARAMETERS
NameTypeStarts at
CallerObject
protectSecondsNumber2.4
SectionEffects
planeExplosionCountNumber30
shakeStrengthNumber0.02
shakeSecondsNumber0.4
flashSecondsNumber0.18
ACTIONS
1Check Cooldown Ready
Action Name
canBeHurt
Applies To
Caller
Cooldown Key
"protection"
2IfcanBeHurt.value == true
Then
3Start ProtectionFunction
caller
Caller
seconds
protectSeconds
4Burst Particles
Applies To
Caller
Particles
"Plane Explosion"
Count
planeExplosionCount
Z Index Offset
2
5Control Sound
Applies To
Caller
Sound
"Fighter Hit"
6Camera Shake
Applies To
Caller
Intensity
shakeStrength
Seconds
shakeSeconds
7Camera Flash
Applies To
Caller
Color
"#ff5a3c"
Seconds
flashSeconds
8Trigger Custom Event
Applies To
Caller
Custom Event
fighterHit

A.21 Lose a Gun Level

Built in Chapter 4, Mission Failed.

Logic ComponentLose a Gun LevelAttach to: Game Rules

Each hit on the Fighter costs one gun level, but the gun level never goes below 1.

Attach toAny Object
On Fighter Hit
WhenfighterHitCustom Event
1If$gunLevel > 1
Then
2Change Variable
Variable
$gunLevel
Operator
-=
Value
1

A.22 Lose a Medkit

Built in Chapter 4, Mission Failed.

Logic ComponentLose a MedkitAttach to: Game Rules

Each hit on the Fighter costs one medkit.

Attach toAny Object
On Fighter Hit
WhenfighterHitCustom Event
1Change Variable
Variable
$medkits
Operator
-=
Value
1
2If$medkits <= 0
Then
3Set Game State
Game State
Mission Failed

A.23 Lost With the Last Medkit

Built in Chapter 4, Mission Failed.

Logic ComponentLost With the Last MedkitAttach to: Fighter

When the mission fails, the Fighter explodes and is removed.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
bigExplosionCountNumberConstant110
smokePuffCountNumberConstant20
shakeStrengthNumberConstant0.035
shakeSecondsNumberConstant0.8
On Game State Changed
WhenGame State Changed
1Check Game State
Action Name
missionFailed
Game State
Mission Failed
2IfmissionFailed.value == true
Then
3Burst Particles
Particles
"Big Explosion"
Count
@self.bigExplosionCount
Z Index Offset
2
4Burst Particles
Particles
"Smoke Puff"
Count
@self.smokePuffCount
Z Index Offset
2
5Control Sound
Sound
"Explosion Large"
6Camera Shake
Intensity
@self.shakeStrength
Seconds
@self.shakeSeconds
7Destroy Instance

A.24 Mission Music

Built in Chapter 4, Mission Failed.

Logic ComponentMission MusicAttach to: Game Rules

Stops the Title Theme; plays the Battle Theme and the engine drone during the mission, the Boss Theme for the Sky Fortress, and the Game Over Jingle or the Victory Jingle at the end.

Attach toAny Object
When the Scene Starts
WhenScene Start
1Control Sound
Operation
Stop
Sound
"Title Theme"
2Control Sound
Operation
Loop
Sound
"Battle Theme"
3Control Sound
Operation
Loop
Sound
"Engine Drone"
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
4Control Sound
Operation
Stop
Sound
"Battle Theme"
5Control Sound
Operation
Stop
Sound
"Boss Theme"
6Control Sound
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"

A.25 Mission Start

Built in Chapter 4, Mission Failed.

Logic ComponentMission StartAttach to: Game Rules

Sets up a fresh mission each time the Gameplay Scene starts: Playing, score 0, startMedkits medkits, gun level startGunLevel.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
startMedkitsNumberConstant3
startGunLevelNumberConstant1
startBombsNumberConstant2
When the Scene Starts
WhenScene Start
1Set Game State
Game State
Playing
2Change Variable
Variable
$score
Value
0
3Change Variable
Variable
$medkits
Value
@self.startMedkits
4Change Variable
Variable
$gunLevel
Value
@self.startGunLevel
5Change Variable
Variable
$weaponName
Value
data("Weapons", "Machine Guns", "label")
6Change Variable
Variable
$bombs
Value
@self.startBombs

A.27 Show If At Least (Function)

Built in Chapter 4, Mission Failed.

FunctionShow If At Least

Shows the caller while a value is at least the given level, and hides it otherwise.

PARAMETERS
NameTypeStarts at
CallerObject
valueNumber0
levelNumber1
ACTIONS
1Ifvalue >= level
Then
2Set Visible
Applies To
Caller
Visible
true
3Otherwise
4Set Visible
Applies To
Caller
Visible
false

A.28 Show Medkits

Built in Chapter 4, Mission Failed.

Logic ComponentShow MedkitsAttach to: Medkit Icon

Shows this medkit icon while the Fighter has at least its number of medkits (1 to 5).

Attach toAny Object
PER INSTANCE VARIABLES
NameTypeStarting Value
levelNumber1
When Created
WhenCreate
1Show If At LeastFunction
caller
self
value
$medkits
level
self.level
On Variable Changed · Medkits
WhenVariable ChangedGlobal Variable: medkits
1Show If At LeastFunction
caller
self
value
$medkits
level
self.level

A.29 Show With Results

Built in Chapter 4, Mission Failed.

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 Prompt, Main Menu Key, Main Menu Prompt

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
2Ifself.anyEnding == true || stateMatches.value == true
Then
3Set Alpha
Alpha
self.opacity
4Set Visible
Visible
Yes

A.30 Start a New Mission (Function)

Built in Chapter 4, Mission Failed.

FunctionStart a New Mission

Starts a new mission: plays Menu Select and restarts the Gameplay Scene.

PARAMETERS
CallerObject
ACTIONS
1Control Sound
Applies To
Caller
Sound
"Menu Select"
2Restart Scene
Applies To
Caller

A.31 Start Protection (Function)

Built in Chapter 4, Mission Failed.

FunctionStart Protection

Protects the caller for some seconds: starts its protection cooldown and its blinking.

PARAMETERS
NameTypeStarts at
CallerObject
secondsNumber2
ACTIONS
1Start Cooldown
Applies To
Caller
Cooldown Key
"protection"
Seconds
seconds
2Trigger Custom Event on Object
Applies To
Caller
Custom Event
protectionStarted

A.32 Wait for the Firing Band (Function)

Built in Chapter 4, Mission Failed.

FunctionWait for the Firing Band

How many seconds from now a plane may first fire: delay seconds, or longer if the plane, flying straight down at speed meters per second, has not yet reached bandTop, the top of its firing band.

PARAMETERS
NameTypeStarts at
CallerObject
bandTopNumber32.813
speedNumber5.938
delayNumber0
RETURN TYPENumber
ACTIONS
1Declare Variable
Name
wait
Value
0
2Declare Variable
Name
secondsToBand
Value
0
3Change Variable
Variable
wait
Value
delay
4Change Variable
Variable
secondsToBand
Value
(Caller.transform.position.y - bandTop) / speed
5IfsecondsToBand > wait
Then
6Change Variable
Variable
wait
Value
secondsToBand
7Return
Value
wait

A.33 Zero Fighter Guns

Built in Chapter 4, Mission Failed.

Logic ComponentZero Fighter GunsAttach to: Zero Fighter

A Zero Fighter fires every couple of seconds while inside its firing band: half the pilots aim down at the Fighter, the rest fire straight down.

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
SHARED VARIABLES
NameTypeKindStarting Value
roundObjectConstantNone
fighterObjectConstantNone
aimedChanceNumberConstant50
firstShotMinNumberConstant0.4
firstShotMaxNumberConstant1.1
shotGapMinNumberConstant1.7
shotGapMaxNumberConstant2.5
straightSpeedNumberConstant7.031
aimedSpeedNumberConstant6.719
aimMinNumberConstant200
aimMaxNumberConstant340
muzzleYNumberConstant-1.219
bandBottomNumberConstant10
bandTopNumberConstant32.813
enemyMuzzleFlashCountNumberConstant5
When Created
WhenCreate
ModeChoose a Pilot (Combined, On at start)
1Generate Random Integer
Action Name
pilotRoll
Maximum
99
2IfpilotRoll.value < @self.aimedChance
Then
3Turn Off Mode
Event
On the Enemy Fire Timer
Mode
Shoot Straight
4Turn On Mode
Event
On the Enemy Fire Timer
Mode
Shoot Aimed
When Created
WhenCreate
ModeWait for the Firing Band (Combined, On at start)
1Generate Random Number
Action Name
firstShot
Minimum
@self.firstShotMin
Maximum
@self.firstShotMax
2Wait for the Firing BandFunction
Action Name
firstShotWait
caller
self
bandTop
@self.bandTop
speed
self.enemyStats.speed
delay
firstShot.value
3Start Recurring Timer
Timer Name
enemyFire
First Delay (s)
firstShotWait.value
Ring Once
Yes
On the Enemy Fire Timer
WhenRecurring TimerTimer name: enemyFire
ModeStill Firing? (Combined, On at start)
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == false || self.transform.position.y <= @self.bandBottom
Then
3Return
On the Enemy Fire Timer
WhenRecurring TimerTimer name: enemyFire
ModeShoot Straight (Combined, On at start)
1Create Instance
Object to Create
@self.round
Position Relative To
Self
Y
@self.muzzleY
2Set Direction
Applies To
created
Direction
270
3Set Speed
Applies To
created
Speed
@self.straightSpeed
On the Enemy Fire Timer
WhenRecurring TimerTimer name: enemyFire
ModeShoot Aimed (Combined)
1Aim Down at the FighterFunction
Action Name
fighterAim
caller
self
fighter
@self.fighter
aimMin
@self.aimMin
aimMax
@self.aimMax
2Create Instance
Object to Create
@self.round
Position Relative To
Self
Y
@self.muzzleY
Created As
created2
3Set Direction
Applies To
created2
Direction
fighterAim.value
4Set Speed
Applies To
created2
Speed
@self.aimedSpeed
On the Enemy Fire Timer
WhenRecurring TimerTimer name: enemyFire
ModeAfter the Shot (Combined, On at start)
1Burst Particles
Particles
"Enemy Muzzle Flash"
Y
@self.muzzleY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
2Control Sound
Sound
"Enemy Guns"
3Generate Random Number
Action Name
nextShot
Minimum
@self.shotGapMin
Maximum
@self.shotGapMax
4Start Recurring Timer
Timer Name
enemyFire
First Delay (s)
nextShot.value
Ring Once
Yes

A.34 Cast Shadow

Built in Chapter 5, Scenery.

Logic ComponentCast ShadowAttach to: Fighter, Zero Fighter, Cloud 1, Cloud 2, Cloud 3, Cloud 4, Red Ace, Dive Bomber, Heavy Bomber, Sky Fortress, Title Plane

Creates this Object's shadow down and to the right of it (the sun is high in the upper left) and attaches it, so the shadow follows every move.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
shadowObjectConstantNone
offsetXNumberConstant0.813
offsetYNumberConstant-1.25
When Created
WhenCreate
1Create Instance
Object to Create
@self.shadow
Position Relative To
Self
X
@self.offsetX
Y
@self.offsetY
2Attach to Parent
Applies To
created
Parent
Its Creator

A.35 Drift and Return

Built in Chapter 5, Scenery.

Logic ComponentDrift and ReturnAttach to: Cloud 1, Cloud 2, Cloud 3, Cloud 4, High Cloud

Drifts straight down. When it has left the view it comes back above the top of the view, at a random place across the screen and a random gap.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
speedNumberConstant3.281
minXNumberConstant-1.875
maxXNumberConstant24.375
gapMinNumberConstant1.25
gapMaxNumberConstant21.875
halfHeightNumberConstant9.438
viewTopNumberConstant33.75
When Created
WhenCreate
1Set Direction
Direction
270
2Set Speed
Speed
@self.speed
When Leaving the View
WhenLeave View
1Generate Random Number
Action Name
returnX
Minimum
@self.minX
Maximum
@self.maxX
2Generate Random Number
Action Name
returnGap
Minimum
@self.gapMin
Maximum
@self.gapMax
3Set Position
X
returnX.value
Y
@self.viewTop + @self.halfHeight + returnGap.value

A.36 Drift in Line

Built in Chapter 5, Scenery.

Logic ComponentDrift in LineAttach to: Jungle Island, Destroyer, Peak Island, Atoll, Carrier, Village Island

Drifts down with the ocean. When it has left the view it comes back above the sea scenery it follows, at a random place across the screen, with open sea between the two pictures, so the pieces never overlap.

Attach toAny Object
DATA STRUCTURES
Sea Scenery Spacingself.seaScenerySpacing
SHARED VARIABLES
NameTypeKindStarting Value
speedNumberConstant1.313
followsObjectConstantNone
seaWidthNumberConstant22.5
openSeaMinNumberConstant1.875
openSeaMaxNumberConstant13.125
When Created
WhenCreate
1Set Direction
Direction
270
2Set Speed
Speed
@self.speed
When Leaving the View
WhenLeave View
1Declare Variable
Name
lineTop
Value
0
2Generate Random Number
Action Name
returnX
Minimum
self.seaScenerySpacing.sideMargin
Maximum
@self.seaWidth - self.seaScenerySpacing.sideMargin
3Change Variable
Variable
lineTop
Value
@self.follows.transform.position.y + @self.follows.seaScenerySpacing.topEdge
4Generate Random Number
Action Name
openSea
Minimum
@self.openSeaMin
Maximum
@self.openSeaMax
5Set Position
X
returnX.value
Y
lineTop + openSea.value + self.seaScenerySpacing.bottomEdge

A.37 Set Opacity

Built in Chapter 5, Scenery.

Logic ComponentSet OpacityAttach to: High Cloud, Banner Strip

Sets how see-through this Object is when it appears (1 is solid, 0 is invisible).

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
opacityNumberConstant1
When Created
WhenCreate
1Set Alpha
Alpha
@self.opacity

A.38 Shadow on Clouds

Built in Chapter 5, Scenery.

Logic ComponentShadow on CloudsAttach to: Fighter Shadow, Zero Fighter Shadow, Red Ace Shadow, Dive Bomber Shadow, Heavy Bomber Shadow, Sky Fortress Shadow

Shows a plane's shadow only on a cloud, clipped to that cloud's picture; over open sea it is hidden.

Attach toAny Object
DATA STRUCTURES
Shadow on Clouds Dataself.shadowOnCloudsData
SHARED VARIABLES
NameTypeKindStarting Value
artPixelsNumberConstant32
sizeMetersNumberConstant3
cloudSizeMetersNumberConstant12
When Created
WhenCreate
1Set Visible
Visible
No
While Hitting Anything Tagged Cloud
WhenCollisionObject: tag:Cloud
ModeLand on This Cloud (Combined, On at start)
1Change Component Value
Component Value
self.shadowOnCloudsData.cloudName
Value
event.otherName
2Change Sprite Mask Property
Value
"sprite"
3Change Sprite Mask Property
Property
Mask Sprite
Value
other.sprite.resource
4Change Sprite Mask Property
Property
Width
Value
@self.cloudSizeMeters * @self.artPixels / @self.sizeMeters
5Change Sprite Mask Property
Property
Height
Value
@self.cloudSizeMeters * @self.artPixels / @self.sizeMeters
6Set Sprite Mask State
7Set Visible
Visible
Yes
8Turn Off Mode
Mode
Land on This Cloud
While Hitting Anything Tagged Cloud
WhenCollisionObject: tag:Cloud
ModeFollow My Cloud (Combined, On at start)
1Ifevent.otherName == self.shadowOnCloudsData.cloudName
Then
2Change Component Value
Component Value
self.shadowOnCloudsData.cloudAcross
Value
other.transform.position.x - self.transform.position.x
3Change Component Value
Component Value
self.shadowOnCloudsData.cloudUp
Value
other.transform.position.y - self.transform.position.y
4Change Sprite Mask Property
Property
Offset X
Value
self.shadowOnCloudsData.cloudAcross * @self.artPixels / @self.sizeMeters
5Change Sprite Mask Property
Property
Offset Y
Value
self.shadowOnCloudsData.cloudUp * @self.artPixels / @self.sizeMeters
When No Longer Hitting Anything Tagged Cloud
WhenCollision LeaveObject: tag:Cloud
1Ifevent.otherName == self.shadowOnCloudsData.cloudName
Then
2Set Visible
Visible
No
3Change Component Value
Component Value
self.shadowOnCloudsData.cloudName
4Turn On Mode
Event
While Hitting Anything Tagged Cloud
Mode
Land on This Cloud

A.39 Make a Row Arrive (Function)

Built in Chapter 6, Mission Timeline.

FunctionMake a Row Arrive

Makes one Mission Timeline row arrive: the Object its object cell names, in the row's formation (a supply drop: one pickup).

PARAMETERS
NameTypeStarts at
CallerObject
rowNumber0
ACTIONS
1Ifdata("Mission Timeline", row, "formation") == "Supply Drop"
Then
2Create Instance
Applies To
Caller
Object to Create
data("Mission Timeline", row, "object")
X
data("Mission Timeline", row, "x")
Y
data("Mission Timeline", row, "entryY")
3Ifdata("Mission Timeline", row, "formation") == "V"
Then
4Spawn V FormationFunction
caller
Caller
enemy
data("Mission Timeline", row, "object")
x
data("Mission Timeline", row, "x")
count
data("Mission Timeline", row, "count")
spacing
data("Mission Timeline", row, "spacing")
entryY
data("Mission Timeline", row, "entryY")
5Ifdata("Mission Timeline", row, "formation") == "Column"
Then
6Spawn ColumnFunction
caller
Caller
enemy
data("Mission Timeline", row, "object")
x
data("Mission Timeline", row, "x")
count
data("Mission Timeline", row, "count")
gap
data("Mission Timeline", row, "spacing")
entryY
data("Mission Timeline", row, "entryY")
7Ifdata("Mission Timeline", row, "formation") == "Row"
Then
8Spawn RowFunction
caller
Caller
enemy
data("Mission Timeline", row, "object")
count
data("Mission Timeline", row, "count")
entryY
data("Mission Timeline", row, "entryY")
9Ifdata("Mission Timeline", row, "formation") == "Side Sweep"
Then
10Spawn Side SweepFunction
caller
Caller
enemy
data("Mission Timeline", row, "object")
edgeX
data("Mission Timeline", row, "x")
count
data("Mission Timeline", row, "count")

A.40 Mission Clock

Built in Chapter 6, Mission Timeline.

Logic ComponentMission ClockAttach to: Game Rules

Counts the mission time ($missionTime): the seconds the mission has been played. A paused game runs no steps, so pauses are not counted.

Attach toAny Object
When the Scene Starts
WhenScene Start
1Change Variable
Variable
$missionTime
Value
0
Every Step
WhenStep
1Change Variable
Variable
$missionTime
Operator
+=
Value
$deltaTime

A.41 Run Waves

Built in Chapter 6, Mission Timeline.

Logic ComponentRun WavesAttach to: Game Rules

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")
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

A.42 Show Banner

Built in Chapter 6, Mission Timeline.

Logic ComponentShow BannerAttach to: Banner Strip, Banner Text

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
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

A.43 Spawn Column (Function)

Built in Chapter 6, Mission Timeline.

FunctionSpawn Column

Creates a single-file line of enemies above the top edge at x, one every "gap" meters upward.

PARAMETERS
NameTypeStarts at
CallerObject
enemyThing Object
xNumber11.25
countNumber4
gapNumber2.813
entryYNumber35.938
ACTIONS
1Repeatcounttimes
Each time
2Create Instance
Applies To
Caller
Object to Create
enemy
X
x
Y
entryY + local.index * gap

A.44 Spawn Row (Function)

Built in Chapter 6, Mission Timeline.

FunctionSpawn Row

Creates a row of enemies spread evenly across the screen, just above the top edge.

PARAMETERS
NameTypeStarts at
CallerObject
enemyThing Object
countNumber4
widthNumber22.5
entryYNumber35.938
ACTIONS
1Repeatcounttimes
Each time
2Create Instance
Applies To
Caller
Object to Create
enemy
X
width * (local.index + 1) / (count + 1)
Y
entryY

A.45 Spawn Side Sweep (Function)

Built in Chapter 6, Mission Timeline.

FunctionSpawn Side Sweep

Creates a diagonal stream of enemies entering from beyond the left or right edge, flying across and down.

PARAMETERS
NameTypeStarts at
CallerObject
enemyThing Object
edgeXNumber0
countNumber5
widthNumber22.5
startOutNumber1.563
stepOutNumber2.344
startYNumber30.938
stepDownNumber1.406
acrossSpeedNumber7.5
fallSpeedNumber2.969
ACTIONS
1IfedgeX > 0
Then
2Repeatcounttimes
Each time
3Create Instance
Applies To
Caller
Object to Create
enemy
X
width + startOut + local.index * stepOut
Y
startY - local.index * stepDown
4Set Velocity
Applies To
created
X Velocity
-acrossSpeed
Y Velocity
-fallSpeed
5Otherwise
6Repeatcounttimes
Each time
7Create Instance
Applies To
Caller
Object to Create
enemy
X
-startOut - local.index * stepOut
Y
startY - local.index * stepDown
Created As
created2
8Set Velocity
Applies To
created2
X Velocity
acrossSpeed
Y Velocity
-fallSpeed

A.46 Dive Attack

Built in Chapter 7, Other Enemies.

Logic ComponentDive AttackAttach to: Dive Bomber

Descends to a random height, hangs there for a moment, then dives at the Fighter and drops a spread of three rounds (once the mission is over it dives straight down).

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
SHARED VARIABLES
NameTypeKindStarting Value
roundObjectConstantNone
fighterObjectConstantNone
stopHeightNumberConstant27.188
stopRangeNumberConstant5
hoverSpeedNumberConstant0.469
hoverSecondsNumberConstant0.7
diveSpeedNumberConstant10.313
aimMinNumberConstant200
aimMaxNumberConstant340
spreadCountNumberConstant3
spreadArcNumberConstant36
roundSpeedNumberConstant7.188
muzzleYNumberConstant-1.219
enemyMuzzleFlashCountNumberConstant5
When Created
WhenCreate
1Declare Variable
Name
descentSeconds
Value
0
2Declare Variable
Name
stopY
Value
0
3Generate Random Number
Action Name
stopBelow
Maximum
@self.stopRange
4Change Variable
Variable
stopY
Value
@self.stopHeight - stopBelow.value
5Change Variable
Variable
descentSeconds
Value
(self.transform.position.y - stopY) / self.enemyStats.speed
6IfdescentSeconds < 0
Then
7Change Variable
Variable
descentSeconds
Value
0
8Start Recurring Timer
Timer Name
descent
First Delay (s)
descentSeconds
Ring Once
Yes
On the Descent Timer
WhenRecurring TimerTimer name: descent
1Set Speed
Speed
@self.hoverSpeed
2Start Recurring Timer
Timer Name
hover
First Delay (s)
@self.hoverSeconds
Ring Once
Yes
On the Hover Timer
WhenRecurring TimerTimer name: hover
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true
Then
3Aim Down at the FighterFunction
Action Name
diveAim
caller
self
fighter
@self.fighter
aimMin
@self.aimMin
aimMax
@self.aimMax
4Set Direction
Direction
diveAim.value
5Fire a SpreadFunction
caller
self
round
@self.round
count
@self.spreadCount
direction
diveAim.value
arc
@self.spreadArc
speed
@self.roundSpeed
muzzleY
@self.muzzleY
6Burst Particles
Particles
"Enemy Muzzle Flash"
Y
@self.muzzleY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
7Control Sound
Sound
"Enemy Guns"
8Otherwise
9Set Direction
Direction
270
10Set Speed
Speed
@self.diveSpeed

A.47 Fire a Spread (Function)

Built in Chapter 7, Other Enemies.

FunctionFire a Spread

Creates count rounds from the caller, fanned evenly over arc degrees around direction, each flying at speed.

PARAMETERS
NameTypeStarts at
CallerObject
roundObjectStructural
Required Components
Slot Nametransform
Component TypeTransform
countNumber3
directionNumber270
arcNumber28
speedNumber7.656
muzzleYNumber0
muzzleXNumber0
ACTIONS
1Repeatcounttimes
Each time
2Create Instance
Applies To
Caller
Object to Create
round
Position Relative To
Self
X
muzzleX
Y
muzzleY
3Ifcount == 1
Then
4Set Direction
Applies To
created
Direction
direction
5Otherwise
6Set Direction
Applies To
created
Direction
direction - arc / 2 + arc * local.index / (count - 1)
7Set Speed
Applies To
created
Speed
speed

A.48 Heavy Bomber Guns

Built in Chapter 7, Other Enemies.

Logic ComponentHeavy Bomber GunsAttach to: Heavy Bomber

Inside its firing band the Heavy Bomber fires a five-round fan every 1.8 s and an aimed round from alternating wing turrets every 1.1 s.

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
SHARED VARIABLES
NameTypeKindStarting Value
roundObjectConstantNone
fighterObjectConstantNone
fanCountNumberConstant5
fanArcNumberConstant60
fanSpeedNumberConstant6.563
fanFirstNumberConstant1.2
fanGapNumberConstant1.8
fanYNumberConstant-1.406
wingRoundSpeedNumberConstant8.75
wingFirstNumberConstant0.6
wingGapNumberConstant1.1
wingOffsetNumberConstant0.844
wingYNumberConstant-0.469
aimMinNumberConstant200
aimMaxNumberConstant340
bandBottomNumberConstant10
bandTopNumberConstant32.813
enemyMuzzleFlashCountNumberConstant5
When Created
WhenCreate
1Wait for the Firing BandFunction
Action Name
bandWait
caller
self
bandTop
@self.bandTop
speed
self.enemyStats.speed
delay
0
2Start Recurring Timer
Timer Name
fan
Repeat Every (s)
@self.fanGap
First Delay (s)
bandWait.value + @self.fanFirst
3Start Recurring Timer
Timer Name
wingShot
Repeat Every (s)
@self.wingGap
First Delay (s)
bandWait.value + @self.wingFirst
On the Fan Timer
WhenRecurring TimerTimer name: fan
1Check Game State
Action Name
stillPlayingForFan
Game State
Playing
2IfstillPlayingForFan.value == true && self.transform.position.y > @self.bandBottom
Then
3Fire a SpreadFunction
caller
self
round
@self.round
count
@self.fanCount
direction
270
arc
@self.fanArc
speed
@self.fanSpeed
muzzleX
0
muzzleY
@self.fanY
4Burst Particles
Particles
"Enemy Muzzle Flash"
Y
@self.fanY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
5Control Sound
Sound
"Enemy Guns"
6Otherwise
7Stop Recurring Timer
Timer Name
fan
On the Wing Shot Timer
WhenRecurring TimerTimer name: wingShot
ModeStill Firing? (Combined, On at start)
1Check Game State
Action Name
stillPlayingForWings
Game State
Playing
2IfstillPlayingForWings.value == false || self.transform.position.y <= @self.bandBottom
Then
3Stop Recurring Timer
Timer Name
wingShot
4Return
On the Wing Shot Timer
WhenRecurring TimerTimer name: wingShot
ModeLeft Wing (Combined, On at start)
1Aim Down at the FighterFunction
Action Name
leftWingAim
caller
self
fighter
@self.fighter
aimMin
@self.aimMin
aimMax
@self.aimMax
2Fire a SpreadFunction
caller
self
round
@self.round
count
1
direction
leftWingAim.value
arc
0
speed
@self.wingRoundSpeed
muzzleX
-@self.wingOffset
muzzleY
@self.wingY
3Burst Particles
Particles
"Enemy Muzzle Flash"
X
-@self.wingOffset
Y
@self.wingY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
4Control Sound
Sound
"Enemy Guns"
5Turn Off Mode
Mode
Left Wing
6Turn On Mode
Mode
Right Wing
On the Wing Shot Timer
WhenRecurring TimerTimer name: wingShot
ModeRight Wing (Combined)
1Aim Down at the FighterFunction
Action Name
rightWingAim
caller
self
fighter
@self.fighter
aimMin
@self.aimMin
aimMax
@self.aimMax
2Fire a SpreadFunction
caller
self
round
@self.round
count
1
direction
rightWingAim.value
arc
0
speed
@self.wingRoundSpeed
muzzleX
@self.wingOffset
muzzleY
@self.wingY
3Burst Particles
Particles
"Enemy Muzzle Flash"
X
@self.wingOffset
Y
@self.wingY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
4Control Sound
Sound
"Enemy Guns"
5Turn Off Mode
Mode
Right Wing
6Turn On Mode
Mode
Left Wing

A.49 Red Ace Guns

Built in Chapter 7, Other Enemies.

Logic ComponentRed Ace GunsAttach to: Red Ace

Fires an aimed burst of three rounds every shotGap seconds while inside the firing band.

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
SHARED VARIABLES
NameTypeKindStarting Value
roundObjectConstantNone
fighterObjectConstantNone
burstCountNumberConstant3
burstArcNumberConstant28
roundSpeedNumberConstant7.656
firstShotMinNumberConstant0.4
firstShotMaxNumberConstant1
shotGapNumberConstant1.7
aimMinNumberConstant200
aimMaxNumberConstant340
muzzleYNumberConstant-1.219
bandBottomNumberConstant10
bandTopNumberConstant32.813
enemyMuzzleFlashCountNumberConstant5
When Created
WhenCreate
1Generate Random Number
Action Name
firstShot
Minimum
@self.firstShotMin
Maximum
@self.firstShotMax
2Wait for the Firing BandFunction
Action Name
firstBurstWait
caller
self
bandTop
@self.bandTop
speed
self.enemyStats.speed
delay
firstShot.value
3Start Recurring Timer
Timer Name
burst
Repeat Every (s)
@self.shotGap
First Delay (s)
firstBurstWait.value
On the Burst Timer
WhenRecurring TimerTimer name: burst
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true && self.transform.position.y > @self.bandBottom
Then
3Aim Down at the FighterFunction
Action Name
fighterAim
caller
self
fighter
@self.fighter
aimMin
@self.aimMin
aimMax
@self.aimMax
4Fire a SpreadFunction
caller
self
round
@self.round
count
@self.burstCount
direction
fighterAim.value
arc
@self.burstArc
speed
@self.roundSpeed
muzzleY
@self.muzzleY
5Burst Particles
Particles
"Enemy Muzzle Flash"
Y
@self.muzzleY
Count
@self.enemyMuzzleFlashCount
Z Index Offset
2
6Control Sound
Sound
"Enemy Guns"
7Otherwise
8Stop Recurring Timer
Timer Name
burst

A.50 Weave

Built in Chapter 7, Other Enemies.

Logic ComponentWeaveAttach to: Red Ace, Power Up Pickup, Spread Shot Pickup, Rapid Guns Pickup, Bomb Crate Pickup, Medkit Pickup

Weaves from side to side on the way down: the sideways speed follows a slow wave, starting at a random point of it.

Attach toAny Object
DATA STRUCTURES
Weave Dataself.weaveData
SHARED VARIABLES
NameTypeKindStarting Value
weaveSpeedNumberConstant6.563
weaveRateNumberConstant2.4
phaseMaxNumberConstant6.28
When Created
WhenCreate
1Generate Random Number
Action Name
phaseRoll
Maximum
@self.phaseMax
2Change Component Value
Component Value
self.weaveData.weavePhase
Value
phaseRoll.value
Every Step
WhenStep
1Change Component Value
Component Value
self.weaveData.secondsFlown
Operator
+=
Value
$deltaTime
2Set Velocity
X Velocity
cos(@self.weaveRate * self.weaveData.secondsFlown + self.weaveData.weavePhase) * @self.weaveSpeed

A.51 Breaks on Bomb

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentBreaks on BombAttach to: Enemy Round, Fortress Shell

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

A.52 Collected by Fighter

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentCollected by FighterAttach to: Power Up Pickup, Spread Shot Pickup, Rapid Guns Pickup, Bomb Crate Pickup, Medkit Pickup

When the Fighter touches this pickup while the mission is being played, it plays its sound and sparkle, sends its collectedEvent and is removed.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
collectSoundSoundConstantPower Up Chime
pickupSparkleCountNumberConstant18
collectedEventTextConstantpowerUpCollected
When Starting to Hit Fighter
WhenCollision EnterObject: Fighter
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true
Then
3Control Sound
Sound
@self.collectSound
4Burst Particles
Particles
"Pickup Sparkle"
Count
@self.pickupSparkleCount
Z Index Offset
2
5Trigger Custom Event
Custom Event
@self.collectedEvent
6Destroy Instance

A.53 Drift Down

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentDrift DownAttach to: Power Up Pickup, Spread Shot Pickup, Rapid Guns Pickup, Bomb Crate Pickup, Medkit Pickup

Falls straight down at fallSpeed and is removed once it is below lowestY.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
fallSpeedNumberConstant2.344
lowestYNumberConstant2.5
When Created
WhenCreate
1Declare Variable
Name
secondsToLowest
Value
0
2Set Velocity
Y Velocity
-@self.fallSpeed
3Change Variable
Variable
secondsToLowest
Value
(self.transform.position.y - @self.lowestY) / @self.fallSpeed
4IfsecondsToLowest < 0
Then
5Change Variable
Variable
secondsToLowest
Value
0
6Start Recurring Timer
Timer Name
sinking
First Delay (s)
secondsToLowest
Ring Once
Yes
On the Sinking Timer
WhenRecurring TimerTimer name: sinking
1Destroy Instance

A.54 Drops a Pickup

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentDrops a PickupAttach to: Zero Fighter, Red Ace, Dive Bomber, Heavy Bomber

When this enemy is shot down it may drop a pickup where it fell: its dropChance in a hundred, the kind picked by the Pickups table's dropWeight.

Attach toAny Object
DATA STRUCTURES
Enemy Statsself.enemyStats
On Shot Down
WhenshotDownCustom Event
1Generate Random Number
Action Name
dropRoll
Maximum
100
2IfdropRoll.value < self.enemyStats.dropChance
Then
3Pick Data Row
Action Name
droppedKind
Table
"Pickups"
Weight Column
dropWeight
4Create Instance
Object to Create
data("Pickups", droppedKind.row, "object")
X
self.transform.position.x
Y
self.transform.position.y

A.55 Drops Bombs

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentDrops BombsAttach to: Fighter

Pressing Bomb while the mission is being played, with a bomb left, sets one off: everything in the sky hears bombDropped, and the Fighter is protected for a moment.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
protectSecondsNumberConstant1.2
bombShockwaveCountNumberConstant140
bombExplosionCountNumberConstant40
flashSecondsNumberConstant0.35
bombShakeStrengthNumberConstant0.03
bombShakeSecondsNumberConstant0.6
When Bomb Is Pressed
WhenCommand PressedCommand: Bomb
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true && $bombs > 0
Then
3Check Cooldown Ready
Action Name
protectionOver
Cooldown Key
protection
4IfprotectionOver.value == true
Then
5Start ProtectionFunction
caller
self
seconds
@self.protectSeconds
6Burst Particles
Particles
"Bomb Shockwave"
Count
@self.bombShockwaveCount
Z Index Offset
2
7Burst Particles
Particles
"Big Explosion"
Count
@self.bombExplosionCount
Z Index Offset
2
8Control Sound
Sound
"Bomb Blast"
9Camera Flash
Seconds
@self.flashSeconds
10Camera Shake
Intensity
@self.bombShakeStrength
Seconds
@self.bombShakeSeconds
11Trigger Custom Event
Custom Event
bombDropped

A.56 Pickup Rewards

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentPickup RewardsAttach to: Game Rules

Gives the reward of each collected pickup, one more of its count up to the most or else bonus points, and shows it over the pickup.

Attach toAny Object
On Power Up Collected
WhenpowerUpCollectedCustom Event
1If$gunLevel < data("Pickups", "Power Up", "most")
Then
2Change Variable
Variable
$gunLevel
Operator
+=
Value
1
3Show the RewardFunction
pickup
other
words
data("Pickups", "Power Up", "popupText")
color
data("Pickups", "Power Up", "popupColor")
4Otherwise
5Change Variable
Variable
$score
Operator
+=
Value
data("Pickups", "Power Up", "bonusPoints")
6Show the RewardFunction
pickup
other
words
+{data("Pickups", "Power Up", "bonusPoints")}
color
data("Pickups", "Power Up", "popupColor")
On Medkit Collected
WhenmedkitCollectedCustom Event
1If$medkits < data("Pickups", "Medkit", "most")
Then
2Change Variable
Variable
$medkits
Operator
+=
Value
1
3Show the RewardFunction
pickup
other
words
data("Pickups", "Medkit", "popupText")
color
data("Pickups", "Medkit", "popupColor")
4Otherwise
5Change Variable
Variable
$score
Operator
+=
Value
data("Pickups", "Medkit", "bonusPoints")
6Show the RewardFunction
pickup
other
words
+{data("Pickups", "Medkit", "bonusPoints")}
color
data("Pickups", "Medkit", "popupColor")
On Bomb Crate Collected
WhenbombCrateCollectedCustom Event
1If$bombs < data("Pickups", "Bomb Crate", "most")
Then
2Change Variable
Variable
$bombs
Operator
+=
Value
1
3Show the RewardFunction
pickup
other
words
data("Pickups", "Bomb Crate", "popupText")
color
data("Pickups", "Bomb Crate", "popupColor")
4Otherwise
5Change Variable
Variable
$score
Operator
+=
Value
data("Pickups", "Bomb Crate", "bonusPoints")
6Show the RewardFunction
pickup
other
words
+{data("Pickups", "Bomb Crate", "bonusPoints")}
color
data("Pickups", "Bomb Crate", "popupColor")

A.57 Show Bombs

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentShow BombsAttach to: Bomb Icon

Shows this bomb icon while the Fighter has at least its number of bombs (1 to 5).

Attach toAny Object
PER INSTANCE VARIABLES
NameTypeStarting Value
levelNumber1
When Created
WhenCreate
1Show If At LeastFunction
caller
self
value
$bombs
level
self.level
On Variable Changed · Bombs
WhenVariable ChangedGlobal Variable: bombs
1Show If At LeastFunction
caller
self
value
$bombs
level
self.level

A.58 Show Rapid Time

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentShow Rapid TimeAttach to: Rapid Meter

Shows the Rapid Guns meter while Rapid Guns lasts, shrinking to nothing as its time runs out.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
rapidSecondsNumberConstant10
On Rapid Guns Started
WhenrapidGunsStartedCustom Event
1Set Scale
2Set Visible
Visible
Yes
3Tween
Value
self.transform.scale.x
Target
0
Duration
@self.rapidSeconds
On Rapid Guns Ended
WhenrapidGunsEndedCustom Event
1Set Visible
Visible
No

A.59 Show the Reward (Function)

Built in Chapter 8, Pickups, Weapons and Bombs.

FunctionShow the Reward

Shows what a collected pickup gave: the words rise from the pickup in the given color.

PARAMETERS
NameTypeStarts at
pickupObjectStructural
Required Components
Slot Nametransform
Component TypeTransform
wordsText
colorColor#ffffff
SectionEffects
popupSizeNumber0.813
popupRiseNumber1.563
popupSecondsNumber0.9
ACTIONS
1Popup Text
Applies To
pickup
Text
words
Color
color
Size
popupSize
Rise
popupRise
Seconds
popupSeconds

A.60 Sound the Guns (Function)

Built in Chapter 8, Pickups, Weapons and Bombs.

FunctionSound the Guns

The gunfire sound and the muzzle flash at the Fighter's nose.

PARAMETERS
NameTypeStarts at
CallerObject
SectionEffects
muzzleFlashCountNumber6
muzzleFlashYNumber1.375
ACTIONS
1Control Sound
Applies To
Caller
Sound
"Fighter Gunfire"
2Burst Particles
Applies To
Caller
Particles
"Muzzle Flash"
Y
muzzleFlashY
Count
muzzleFlashCount
Z Index Offset
2

A.61 Spend a Bomb

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentSpend a BombAttach to: Game Rules

Each bomb set off takes one from $bombs.

Attach toAny Object
On Bomb Dropped
WhenbombDroppedCustom Event
1Change Variable
Variable
$bombs
Operator
-=
Value
1

A.62 Weapon Pickups

Built in Chapter 8, Pickups, Weapons and Bombs.

Logic ComponentWeapon PickupsAttach to: Fighter

Switches the Fighter's weapon when it collects Spread Shot or Rapid Guns, and shows it over the pickup; Rapid Guns lasts rapidSeconds, then the machine guns return.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
rapidSecondsNumberConstant10
On Spread Shot Collected
WhenspreadShotCollectedCustom Event
1Switch Mode
Event
While Fire Is Held (Fighter Guns)
Mode
Spread Shot
2Change Variable
Variable
$weaponName
Value
data("Weapons", "Spread Shot", "label")
3Stop Recurring Timer
Timer Name
rapidGuns
4Trigger Custom Event
Custom Event
rapidGunsEnded
5Show the RewardFunction
pickup
other
words
data("Pickups", "Spread Shot", "popupText")
color
data("Pickups", "Spread Shot", "popupColor")
On Rapid Guns Collected
WhenrapidGunsCollectedCustom Event
1Switch Mode
Event
While Fire Is Held (Fighter Guns)
Mode
Rapid Guns
2Change Variable
Variable
$weaponName
Value
data("Weapons", "Rapid Guns", "label")
3Start Recurring Timer
Timer Name
rapidGuns
Repeat Every (s)
@self.rapidSeconds
First Delay (s)
@self.rapidSeconds
Ring Once
Yes
4Trigger Custom Event
Custom Event
rapidGunsStarted
5Show the RewardFunction
pickup
other
words
data("Pickups", "Rapid Guns", "popupText")
color
data("Pickups", "Rapid Guns", "popupColor")
On the Rapid Guns Timer
WhenRecurring TimerTimer name: rapidGuns
1Reset Modes
Event
While Fire Is Held (Fighter Guns)
2Change Variable
Variable
$weaponName
Value
data("Weapons", "Machine Guns", "label")
3Trigger Custom Event
Custom Event
rapidGunsEnded

A.65 Calls Escorts

Built in Chapter 9, The Sky Fortress.

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

A.66 Enraged Fortress Guns

Built in Chapter 9, The Sky Fortress.

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

A.67 Fortress Guns

Built in Chapter 9, The Sky Fortress.

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

A.68 Fortress Health Fill

Built in Chapter 9, The Sky Fortress.

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

A.69 Mission Complete

Built in Chapter 9, The Sky Fortress.

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

A.70 Mission Over

Built in Chapter 9, The Sky Fortress.

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); then FLY AGAIN and MAIN MENU after a loss, or RETURN TO BASE after a win, are switched 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"
5Otherwise
6Set Logic State
Logic Component
"Return to Base"

A.71 Patrol

Built in Chapter 9, The Sky Fortress.

Logic ComponentPatrolAttach to: Sky Fortress, Title Plane

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).

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

A.72 Show With Fortress

Built in Chapter 9, The Sky Fortress.

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

A.73 Sinks When Shot Down

Built in Chapter 9, The Sky Fortress.

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

A.74 Sky Fortress Battle

Built in Chapter 9, The Sky Fortress.

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
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
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

A.75 Stops When the Mission Is Won

Built in Chapter 9, The Sky Fortress.

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

A.76 Back to the Main Menu (Function)

Built in Chapter 10, Title and Menus.

FunctionBack to the Main Menu

Plays Menu Select, stops the mission's music and engine drone, starts the Title Theme and fades to the Main Menu.

PARAMETERS
NameTypeStarts at
SectionEffects
fadeSecondsNumber0.35
ACTIONS
1Control Sound
Sound
"Menu Select"
2Control Sound
Operation
Stop
Sound
"Battle Theme"
3Control Sound
Operation
Stop
Sound
"Boss Theme"
4Control Sound
Operation
Stop
Sound
"Engine Drone"
5Control Sound
Operation
Loop
Sound
"Title Theme"
6Go to Scene
Scene
Main Menu
Transition
Fade
Transition Seconds
fadeSeconds

A.77 Close How to Play (Function)

Built in Chapter 10, Title and Menus.

FunctionClose How to Play

Plays Menu Move and closes the How to Play panel (howToPlayClosed).

ACTIONS
1Control Sound
Sound
"Menu Move"
2Trigger Custom Event
Custom Event
howToPlayClosed

A.78 Do What Was Chosen (Function)

Built in Chapter 10, Title and Menus.

FunctionDo What Was Chosen

Does the job of the chosen Main Menu button ($menuChoice): START MISSION, HOW TO PLAY or QUIT GAME.

ACTIONS
1If$menuChoice == 0
Then
2Start the MissionFunction
3If$menuChoice == 1
Then
4Open How to PlayFunction
5If$menuChoice == 2
Then
6Quit the GameFunction

A.79 Go to the Main Menu (Function)

Built in Chapter 10, Title and Menus.

FunctionGo to the Main Menu

Plays Menu Select and fades to the Main Menu.

PARAMETERS
NameTypeStarts at
SectionEffects
fadeSecondsNumber0.35
ACTIONS
1Control Sound
Sound
"Menu Select"
2Go to Scene
Scene
Main Menu
Transition
Fade
Transition Seconds
fadeSeconds

A.80 Keep a Better Score (Function)

Built in Chapter 10, Title and Menus.

FunctionKeep a Better Score

Saves the score as the high score on this device when it beats the high score.

ACTIONS
1If$score > $highScore
Then
2Change Variable
Variable
$highScore
Value
$score
3Save Persistent Value
Action Name
highScoreSaved
Key
"highScore"
Value
$highScore

A.81 Lit When Chosen

Built in Chapter 10, Title and Menus.

Logic ComponentLit When ChosenAttach to: Menu Button Lit

Shows this lit button while its choice is the chosen one.

Attach toAny Object
PER INSTANCE VARIABLES
NameTypeStarting Value
choiceNumber0
When Created
WhenCreate
1Show If ChosenFunction
caller
self
choice
self.choice
On Variable Changed · Menu Choice
WhenVariable ChangedGlobal Variable: menuChoice
1Show If ChosenFunction
caller
self
choice
self.choice

A.84 Open How to Play (Function)

Built in Chapter 10, Title and Menus.

FunctionOpen How to Play

Plays Menu Select and opens the How to Play panel (howToPlayOpened).

ACTIONS
1Control Sound
Sound
"Menu Select"
2Trigger Custom Event
Custom Event
howToPlayOpened

A.85 Pause

Built in Chapter 10, Title and Menus.

Logic ComponentPauseAttach to: Game Rules

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.

Attach toAny Object
When Pause Is Pressed
WhenCommand PressedCommand: Pause
1Check Game State
Action Name
stillPlaying
Game State
Playing
2IfstillPlaying.value == true
Then
3Control Sound
Sound
"Menu Move"
4Trigger Custom Event
Custom Event
showPauseOverlay
On Resume Pause Overlay
WhenresumePauseOverlayCustom Event
1Control Sound
Sound
"Menu Select"
On Quit Mission
WhenquitMissionCustom Event
1Trigger Custom Event
Custom Event
hidePauseOverlay
2Set Game Paused
Paused (1 pause / 0 resume)
0
3Trigger Custom Event
Custom Event
missionQuit
4Back to the Main MenuFunction

A.86 Pause Overlay Lifecycle

Comes whole from Myth’s templates. Built in Chapter 10, Title and Menus.

Logic ComponentPause Overlay LifecycleAttach to: Game Rules

Composes global simulation pause with the independent viewport-fixed pause-overlay transport.

Attach toAny Object
SHARED VARIABLES
NameTypeKindStarting Value
pauseMenuSpecTextConstant{"title":"Paused","items":[{"id":"resumePauseOverlay","label":"Resume"}]}
Built in: this Logic Component comes whole from the engine's template.
You add it and set its Variables on the Object; you do not build its Events.

A.87 Quit the Game (Function)

Built in Chapter 10, Title and Menus.

FunctionQuit the Game

Plays Menu Select and ends the game.

ACTIONS
1Control Sound
Sound
"Menu Select"
2End Game

A.88 Return to Base

Built in Chapter 10, Title and Menus.

Logic ComponentReturn to BaseAttach to: Game Rules

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).

Attach toAny Object
When Confirm Is Pressed
WhenCommand PressedCommand: Confirm
1Back to the Main MenuFunction
When Fire Is Pressed
WhenCommand PressedCommand: Fire
1Back to the Main MenuFunction
When Pause Is Pressed
WhenCommand PressedCommand: Pause
1Back to the Main MenuFunction

A.89 Show If Chosen (Function)

Built in Chapter 10, Title and Menus.

FunctionShow If Chosen

Shows the caller while its choice is the chosen Main Menu button, and hides it otherwise.

PARAMETERS
NameTypeStarts at
CallerObject
choiceNumber0
ACTIONS
1If$menuChoice == choice
Then
2Set Visible
Applies To
Caller
Visible
true
3Otherwise
4Set Visible
Applies To
Caller
Visible
false

A.90 Show With How to Play

Built in Chapter 10, Title and Menus.

Logic ComponentShow With How to PlayAttach to: How to Play Veil, How to Play Panel, How to Play Text, How to Play Strip, How to Play Key, How to Play Pickup

Shows this How to Play piece while the panel is open.

Attach toAny Object
On How to Play Opened
WhenhowToPlayOpenedCustom Event
1Set Visible
Visible
Yes
On How to Play Closed
WhenhowToPlayClosedCustom Event
1Set Visible
Visible
No

A.91 Start the Mission (Function)

Built in Chapter 10, Title and Menus.

FunctionStart the Mission

Plays Menu Select and fades to Gameplay, where Mission Start sets up a fresh mission.

ACTIONS
1Control Sound
Sound
"Menu Select"
2Go to Scene
Scene
Gameplay
Transition
Fade
Transition Seconds
0.5

A.92 Take Off

Built in Chapter 10, Title and Menus.

Logic ComponentTake OffAttach to: Title Controls

On the Title, Confirm (Enter, Space, or a left click anywhere) goes to the Main Menu.

Attach toAny Object
When Confirm Is Pressed
WhenCommand PressedCommand: Confirm
1Go to the Main MenuFunction

A.93 Title Music

Built in Chapter 10, Title and Menus.

Logic ComponentTitle MusicAttach to: Title Controls

Loops the Title Theme from the moment the game starts.

Attach toAny Object
When the Game Starts
WhenGame Start
1Control Sound
Operation
Loop
Sound
"Title Theme"

A.94 Use Flight Controls

Built in Chapter 10, Title and Menus.

Logic ComponentUse Flight ControlsAttach to: Game Rules

When a mission starts, the Flight controls are on and the Title controls off.

Attach toAny Object
When the Scene Starts
WhenScene Start
1Set Input Context Active
Input Context
Flight
2Set Input Context Active
Input Context
Title
Active
No

A.95 Use Menu Controls

Built in Chapter 10, Title and Menus.

Logic ComponentUse Menu ControlsAttach to: Menu Controls

When the Main Menu starts, its Menus controls are on and the Title controls off.

Attach toAny Object
When the Scene Starts
WhenScene Start
1Set Input Context Active
Input Context
Menus
2Set Input Context Active
Input Context
Title
Active
No