- Learn
- Build a Game
- Sky Ace
- 5 Scenery
5 Scenery
Islands, a destroyer and a carrier drift by on the sea below. Clouds slide over them, faster, each with its shadow on the water, and now and then a pale cloud sweeps over everything. Every plane casts a shadow too, and you see it only where it falls on a cloud. By the end of this chapter, the sea under the Fighter is alive.
The game as it is at the end of this chapter. Click the game to play.
If the game shows Tap to play, it waits for your click, and its one V comes three seconds after it. Some browsers show no Tap to play. There the mission starts as the Myth Engine logo fades, and the V three seconds later. Missed it? Reload the page.
This chapter builds on Chapter 4’s game. Starting here? The catch-up download in Chapter 4’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 6 from it.
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.
5.1 The Idea
In Chapter 1 the sea was empty blue. Now, as the mission starts, an island thick with jungle is already sliding out at the bottom. A destroyer comes down after it, trailing a white wake. An island with a gray peak comes next, ringed with sand and pale shallow water. Later come a tiny atoll, a carrier with a long wooden deck, and an island of huts and a jetty.
None of them moves on the water. They ride the sea down at its pace. So they seem to sit still while the Fighter flies over them.
These six are the sea scenery: four islands and two ships. When one drifts out at the bottom of the window, it comes back above the top. Each piece knows where, so no two ever land on each other.
Above them, white clouds drift down faster. That speed is the trick. Things that slide faster look closer, so the clouds seem to hang high above the sea, close under the Fighter.
Under each cloud, down and to the right, a gray patch slides over the water with it. That’s its shadow. The sun in Sky Ace stands high in the upper left, so every shadow falls the same way.
The planes have shadows too, and they’re the puzzle of this chapter. A plane flies so high that its shadow on the sea would be lost. But fly the Fighter beside a cloud, and a dark Fighter shape lies on the cloud. Where the cloud’s edge curves, the shadow is cut off along it. Over open sea, there’s nothing at all.
That cut is a sprite mask. It works like a stencil laid over the shadow, with a hole the shape of the cloud’s picture. Where the hole is, the shadow shows through. Everywhere else, nothing does.
5.2 The Plan
Here’s how the pieces work together, read from left to right.
- A piece of sea scenery appears -> Drift in Line sends it down at the sea’s speed.
- It leaves the view at the bottom -> Drift in Line puts it back above the piece it follows, with open sea between.
- A cloud appears -> Drift and Return sends it down, faster -> Cast Shadow makes its shadow and fastens it on.
- A cloud leaves the view -> Drift and Return puts it back above the top.
- The High Cloud appears -> Set Opacity makes it see-through -> Drift and Return sends it down, faster still.
- A plane appears -> Cast Shadow makes its shadow -> Shadow on Clouds hides it.
- The shadow touches a cloud -> Shadow on Clouds’ Land on This Cloud cuts the stencil from that cloud and shows it -> its Follow My Cloud keeps it lined up.
- The shadow slips off its cloud -> Shadow on Clouds hides it again.
5.3 Set Up
This chapter uses sixteen more pictures. They’re already in your project, from the Starter Kit. The Game Settings don’t change.
Place each Object from PLACE THESE as you make it. You’ll make the six pieces of sea scenery in the first part, the four clouds in the second and the High Cloud in the third. The shadows are never placed, because Cast Shadow makes each one while the game runs.
5.4 Islands and Ships
First, the sea gets something to fly over.
Every piece’s picture is the same 12-meter square. The island or ship is drawn in its middle at its own size, and the rest of the square is clear. The atoll is a speck of sand and palms, and the carrier is long. So the square tells nothing about the piece. Each piece carries three numbers about itself instead.
5.4.1 Sea Scenery Spacing
Sea Scenery Spacing is the Data Structure that holds those three numbers, in meters. The first, sideMargin, keeps the piece’s middle far enough in from the sides of the sea. A wide island needs more room there than the atoll does.
The other two, topEdge and bottomEdge, measure the drawn island or ship, up and down from its middle. The clear part of the square doesn’t count. The destroyer reaches farther below its middle than above, 5.90625 against 4.96875, because its wake trails behind it.
How a piece of sea scenery is spaced (meters): how far in from the sides of the screen it comes back, and how far its picture reaches above and below its center. Each piece takes the values from its own row of Sea Scenery.
5.4.2 Sea Scenery
The numbers come from a table, Sea Scenery. It has one row for each piece. A row’s name in the Entry column is its Object’s name, letter for letter.
Its columns are Sea Scenery Spacing’s fields. You made Enemy Types this way in Chapter 3. Make the Data Structure first, then the table, and pick Sea Scenery Spacing in its Entry Type. The table also made a Sea Scenery Entry of its own. Nothing uses it, so delete it. The six rows come after.
4.68754.8754.781252.81254.968755.906254.3754.406254.406252.51.781251.781253.1255.718755.906254.06253.56253.468755.4.3 Drift in Line
A piece of sea scenery drifts straight down at 1.313 meters a second. That’s the pace the Pacific Ocean slides, so the piece seems to sit still on the water. When Created points it at 270 degrees and gives it that speed. Fly Down does that for a Zero Fighter.
The second Event is When Leaving the View, as in Remove When Out of View. It runs once, when the piece has left the window. This time the piece isn’t removed. It comes back above the top, and where it lands takes a little care.
Every piece follows another. When a piece leaves at the bottom, the one it follows is the highest piece on the sea. Coming back, the piece goes above it, with some open sea between the two. So the six keep their turns, like children at a slide, each climbing up behind the last one in line.
Where exactly does it go? Across the sea, it lands anywhere at least sideMargin in from either edge of the sea, which is seaWidth across. Up the screen, it goes above the top edge of the piece it follows, and that edge is lineTop. Between lineTop and its own bottom edge lies open sea, from 1.875 to 13.125 meters of it. So the two never touch, however big or small they are.
Two Generate Random Numbers make the choices. You met one in Chapter 4, picking firstShot. Each one’s Action Name says where to find its answer: returnX.value across, and openSea.value up.
Make what the Logic keeps first, since its blocks name it. Under DATA STRUCTURES, the piece reads its own Sea Scenery Spacing. Press the + on the Data Structures card and pick it under Existing Data Structures, as on Fly Down. Under SHARED VARIABLES come five Constants, and one of them, follows, is an Object. Its Starting Value stays at None. Each piece picks its own.
lineTop is made by the Event itself. When Leaving the View starts with a Declare Variable, a Number named lineTop. Its Value box starts empty. Type the card’s 0. After that, Change Variable’s Variable box takes lineTop as you type it.
One box here falls short, and it belongs to Myth, not to you. The card’s Change Variable adds two things: where the piece it follows sits, and how far that piece reaches above its middle, its topEdge. Myth can read the first today. The second it can’t, yet. It can’t reach into follows’ Sea Scenery Spacing, so it marks that part red, and the game won’t start. So type only the first part, @self.follows.transform.position.y.
Your pieces then measure their open sea from the middle of the piece they follow, not from its top edge. Now and then, two may come back close enough to touch. The finished game keeps them apart.
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.
Any Objectself.seaScenerySpacing- Direction
270
- Speed
@self.speed
- Name
lineTop- Value
0
- Action Name
returnX- Minimum
self.seaScenerySpacing.sideMargin- Maximum
@self.seaWidth - self.seaScenerySpacing.sideMargin
- Variable
lineTop- Value
@self.follows.transform.position.y + @self.follows.seaScenerySpacing.topEdge
- Action Name
openSea- Minimum
@self.openSeaMin- Maximum
@self.openSeaMax
- X
returnX.value- Y
lineTop + openSea.value + self.seaScenerySpacing.bottomEdge
5.4.4 The Six Pieces
Each piece is an Empty Object with a Sprite and a Data Structure. Its Sprite is its own art, 12 meters across. Its Data Structure fills itself from its row, the way a Zero Fighter’s does, with Sea Scenery in place of Enemy Types.
Their Draw Orders, from -39 to -41, keep all six under everything but the sea. No two pieces ever overlap, so the small steps between them never show. Type each one as its card has it.
Last comes Drift in Line, with its follows. Each piece follows the one that starts nearest below it on the sea. Jungle Island starts lowest, and it follows Village Island, which starts highest. So the six make a ring.
Because of that ring, make all six Objects first. After that, come back and pick each one’s follows, a button under the Object’s Shared Variables. Its list holds only Objects that exist.
Six Objects this alike needn’t each be built from nothing. Build Jungle Island from its card, then right-click it in the Resources and choose its Duplicate line. Myth makes a copy named Jungle Island2 and opens it.
Type the next piece’s name over that, in the Name box at the top of its Properties. Then change what its card has that Jungle Island’s doesn’t: the picture, the Draw Order where it differs, and its follows.
X 12, Y 12-40Jungle Island ArtX 12, Y 12Sea Scenery SpacingData TableSea SceneryVillage IslandX 12, Y 12-39Destroyer ArtX 12, Y 12Sea Scenery SpacingData TableSea SceneryJungle IslandX 12, Y 12-40Peak Island ArtX 12, Y 12Sea Scenery SpacingData TableSea SceneryDestroyerX 12, Y 12-41Atoll ArtX 12, Y 12Sea Scenery SpacingData TableSea SceneryPeak IslandX 12, Y 12-39Carrier ArtX 12, Y 12Sea Scenery SpacingData TableSea SceneryAtollX 12, Y 12-40Village Island ArtX 12, Y 12Sea Scenery SpacingData TableSea SceneryCarrierPlace all six from PLACE THESE, each at its World Position. Some start far above the window, to drift into view in their turn.
Save with Ctrl+S, and run the game. Jungle Island is already sliding out at the bottom right. Above it, the destroyer slides down the middle with its wake spreading behind. Peak Island sits up on the left. A tiny atoll comes next, then the carrier.
Keep watching. Within half a minute, an island with huts and a jetty drifts in at the top. Pieces leave at the bottom and come back at the top. None ever lands on another.
5.5 Clouds
Now the sky between the Fighter and the sea fills with clouds.
5.5.1 Drift and Return
A cloud drifts straight down at a little over three meters a second, more than twice the sea’s speed. When it has left the view, it comes back above the top, at a random place across the screen and a random gap above. Clouds don’t keep turns. Two of them may even overlap.
So Drift and Return is Drift in Line with less to keep track of. No piece to follow means no lineTop. A cloud coming back picks a place across and a gap at random. Its middle goes above viewTop, the top of the view, by that gap plus one more number, halfHeight.
Why halfHeight? It’s room below the cloud’s middle for the cloud and its shadow. Each cloud is drawn in the middle of its clear 12-meter square, as the islands are, and its shadow hangs 3 meters lower. At 9.438, halfHeight is room for both, with some to spare. With much less, a cloud could come back with its shadow’s lower edge already in sight.
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.
Any Object- Direction
270
- Speed
@self.speed
- Action Name
returnX- Minimum
@self.minX- Maximum
@self.maxX
- Action Name
returnGap- Minimum
@self.gapMin- Maximum
@self.gapMax
- X
returnX.value- Y
@self.viewTop + @self.halfHeight + returnGap.value
Its Shared Variables start at the numbers every cloud uses. A cloud’s card sets none of them, so leave them as they start.
5.5.2 Cast Shadow
A shadow is an Object of its own, a darker copy of its owner’s picture. Cast Shadow makes it at the moment its owner appears.
First, Create Instance makes the shadow, offsetX to the right of its owner and offsetY above it. A negative offsetY puts it below. Then Attach to Parent fastens the new shadow to its owner. From then on, the shadow moves when its owner moves. It goes when its owner goes.
Attach to Parent makes a link while the game runs. The shadow stays the Object it was, with its own Logic, and its owner keeps its own. The shadow only rides along.
Why not place the shadows in the Scene? Planes arrive while the mission runs, so their shadows can’t be placed ahead of time. The clouds use the same piece, so every shadow in the game is made one way.
Its Shared Variables are shadow, an Object, and the two offsets. The Starting Value of shadow stays at None. Each owner picks its own shadow.
When Attach to Parent is added, it’s already aimed at created, the new shadow, and needs only its Parent. That list holds Its Creator, the Object whose Cast Shadow made the shadow. So the shadow rides with its own owner.
Which shadow does Create Instance make, then, of all the Objects in your game? The one this owner carries. That’s @self.shadow. Open its Object to Create list, and it’s there under self. Pick it. A cloud makes its own shadow then, and a plane makes its own.
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.
Any Object- Object to Create
@self.shadow- Position Relative To
Self- X
@self.offsetX- Y
@self.offsetY
- Applies To
created- Parent
Its Creator
5.5.3 Four Cloud Shadows
Cloud 1 Shadow is the darker twin of Cloud 1. It’s an Empty Object with a Sprite, 12 meters across, at a Draw Order of -30: under the clouds, over the sea scenery. So a cloud that passes over a ship lays its shadow across the deck.
The other three are made the same way, or duplicated from it. Name each copy, as with the islands. Give it its own picture.
X 12, Y 12-30Cloud 1 Shadow ArtX 12, Y 12X 12, Y 12-30Cloud 2 Shadow ArtX 12, Y 12X 12, Y 12-30Cloud 3 Shadow ArtX 12, Y 12X 12, Y 12-30Cloud 4 Shadow ArtX 12, Y 125.5.4 The Four Clouds
The clouds need one more name before you build them. Each cloud’s Collider meets only Tagged Plane Shadow, the Tag every plane’s shadow will wear. A list names a Tag only once an Object wears it. So start Fighter Shadow now, from its card in the last part, up to and including its Tag, Plane Shadow. Its Collide Only With and its Logic wait for that part.
A cloud is a 2D Object. Every cloud wears the Tag Cloud. Its card’s Transform ends with Physics Object Off, so switch that off. Nothing can shove a cloud then, though its own Logic still moves it, and it can drift out at the bottom and wait above the top.
Its Collider is a box fitted around the drawn cloud, inside the clear square. It’s there so a plane’s shadow can tell it’s over a cloud. Its Collision stays Solid, as it starts. It still never blocks anything, because the planes’ shadows are Sensors.
Last come its Logic, Cast Shadow and Drift and Return, and its Shared Variables. Its shadow is its own: Cloud 1 Shadow for Cloud 1, 1.875 meters to the right and 3 below.
The other three clouds can start as copies. Duplicate Cloud 1, and Myth names the copy Cloud 2 for you. There’s no new name to type.
The copy keeps everything. Even its shadow is still Cloud 1’s, so change that too, with the picture and the Collider’s size.
X 12, Y 12Off-20Cloud 1 ArtX 12, Y 12X 8.063, Y 7.5Collide Only WithTagged Plane ShadowCloudCloud 1 Shadow1.875-3X 12, Y 12Off-20Cloud 2 ArtX 12, Y 12X 6.563, Y 6.938Collide Only WithTagged Plane ShadowCloudCloud 2 Shadow1.875-3X 12, Y 12Off-20Cloud 3 ArtX 12, Y 12X 9.188, Y 8.438Collide Only WithTagged Plane ShadowCloudCloud 3 Shadow1.875-3X 12, Y 12Off-20Cloud 4 ArtX 12, Y 12X 6.375, Y 6.75Collide Only WithTagged Plane ShadowCloudCloud 4 Shadow1.875-3Place the four clouds from PLACE THESE.
Save, and run the game. The clouds come down quicker than the islands, white and round. When a cloud leaves at the bottom, it comes back at the top somewhere new.
Each brings its gray shadow along, down and to the right. The shadows slide over the sea, and over the islands and ships too.
5.6 The High Cloud
One more cloud flies higher than everything else.
The High Cloud is a thin veil that passes over the whole battle, the Fighter too. It’s Cloud 3’s picture again, drawn see-through.
5.6.1 Set Opacity
You’ve set an opacity once before, in Chapter 4. There the dark veil behind GAME OVER took it from a Variable of Show With Results. The High Cloud has no result screen to wait for, so its opacity gets a Logic Component of its own.
A Sprite has no opacity setting of its own, so Set Opacity sets it once, as its Object appears. Its one Action is Set Alpha. It takes opacity, a Shared Variable: 1 is solid, and 0 is gone.
Sets how see-through this Object is when it appears (1 is solid, 0 is invisible).
Any Object- Alpha
@self.opacity
The High Cloud is an Empty Object with a Sprite, and its Draw Order of 60 puts it over everything, even the Fighter’s 30. Its opacity under Shared Variables makes it a little less than half solid, so the battle shows through it. Drift and Return gets values of its own there too. It drifts more than four times as fast as the sea, with long gaps between its visits.
Its halfHeight is smaller too, 5.625. No shadow hangs under it, so it needs room only for the cloud drawn in its square.
X 12, Y 1260Cloud 3 ArtX 12, Y 125.938-2.52528.12581.255.6250.42Place it from PLACE THESE. It starts far above the window, so it takes a few seconds to arrive.
Save, and run the game. A few seconds in, a pale cloud slides down over everything: the islands, the clouds, the planes and the Fighter. You can see them all through it. Then it’s gone, and a while passes before it comes again.
5.7 Shadows on the Clouds
Last, the planes get their shadows.
A plane’s shadow shows only through its stencil. And the stencil has to be cut again for each cloud the shadow meets. No two clouds are the same shape.
5.7.1 Shadow on Clouds
Shadow on Clouds is the stencil cutter, and it goes on every plane’s shadow. Its card is the longest in this chapter, so it comes here in three pieces, each beside its words.
Make what it keeps first. A shadow has to remember its cloud between one step and the next: the cloud’s name, and how far the cloud’s middle is from its own. Those three live in a Data Structure of the Logic’s own. Press the + on the Data Structures card and choose New Data Structure. Myth names it Shadow on Clouds Data, after the Logic, and opens it in a tab of its own. Give it the three fields from its card.
Object Data of Logic "Shadow on Clouds" (its state that lasts between Events).
The three Shared Variables are about the pictures. A plane’s shadow picture is 32 pixels across for its 3 meters, and a cloud’s picture is 12 meters wide.
When Created hides the shadow, and it stays hidden until it meets a cloud.
Shows a plane's shadow only on a cloud, clipped to that cloud's picture; over open sea it is hidden.
Any Objectself.shadowOnCloudsData- Visible
No
While Hitting Anything Tagged Cloud is a Collision Event. It runs every step while the shadow touches anything that wears the Tag Cloud. Press Add Event, choose Collision, and open the Collision section on the Event’s block. Pick Tagged Cloud in its Collision Target list. Myth names the Event While Hitting Anything Tagged Cloud as soon as it’s picked. Events: the When bars has the rest.
It has two jobs, so it’s Combined, with two Modes, both On at start. Land on This Cloud cuts the stencil once for each cloud the shadow meets. Then it steps aside. Follow My Cloud keeps the stencil lined up, every step the shadow is there.
You’ve made Modes like these in Chapter 4. Your hands know them now. Rename Mode 1 to Land on This Cloud, and add Follow My Cloud with New Mode…. Pick Combined, and turn On at start on for both. The card shows the Event twice, once for each Mode, but it’s one Event. Each Mode has its own line, so give each its blocks in turn.
First, Land on This Cloud remembers the cloud. A Change Component Value puts event.otherName, the name of the Object the shadow touches, into cloudName. Then four Change Sprite Mask Properties shape the stencil.
The first makes the stencil’s Shape a picture, "sprite", instead of an ellipse. The second picks which picture: the cloud’s own, which the shadow reaches as other.sprite.resource. The third and fourth match the cloud’s size. The stencil sits on the shadow’s picture, so it’s measured in that picture’s pixels, 32 for every 3 meters. The card’s formula turns the cloud’s 12 meters into those.
Then the stencil goes on. The shadow shows. Last, Land on This Cloud takes itself out with Turn Off Mode. Its work is done until the shadow leaves.
Follow My Cloud runs every step. The cloud and the plane drift at different speeds, so the stencil has to keep up with the cloud. Its If asks first whether this is the shadow’s own cloud. A second cloud passing by is ignored.
Next, cloudAcross and cloudUp measure how far the cloud’s middle is from the shadow’s, in meters. The stencil’s Offset X and Offset Y take those, turned into the art’s pixels the same way.
A few boxes here want care.
- The first Change Sprite Mask Property keeps Shape in its Property list. Its Value starts as
"ellipse", so type"sprite"over it, quotes and all. - Each of the others picks its own Property.
- Set Sprite Mask State already starts on.
- Turn Off Mode names no Event, so it works on the Current Event, where its Event list starts. Pick Land on This Cloud in its Mode list.
One block in Shadow on Clouds can’t be built yet. That’s Myth’s gap, not yours. The Mask Sprite box doesn’t keep other.sprite.resource. Once you leave the box, it goes back to "ellipse", as if you’d typed nothing. Leave that block out for now. Build the rest. The shadow still shows on a cloud and hides over the sea. It isn’t cut along the cloud’s edge yet.
- Component Value
self.shadowOnCloudsData.cloudName- Value
event.otherName
- Value
"sprite"
- Property
Mask Sprite- Value
other.sprite.resource
- Property
Width- Value
@self.cloudSizeMeters * @self.artPixels / @self.sizeMeters
- Property
Height- Value
@self.cloudSizeMeters * @self.artPixels / @self.sizeMeters
- Visible
Yes
- Mode
Land on This Cloud
event.otherName == self.shadowOnCloudsData.cloudName- Component Value
self.shadowOnCloudsData.cloudAcross- Value
other.transform.position.x - self.transform.position.x
- Component Value
self.shadowOnCloudsData.cloudUp- Value
other.transform.position.y - self.transform.position.y
- Property
Offset X- Value
self.shadowOnCloudsData.cloudAcross * @self.artPixels / @self.sizeMeters
- Property
Offset Y- Value
self.shadowOnCloudsData.cloudUp * @self.artPixels / @self.sizeMeters
When No Longer Hitting Anything Tagged Cloud runs once, as the shadow slips off a cloud. Add it the same way, with Collision Leave, and Tagged Cloud in its Collision Target list. If that’s the shadow’s own cloud, the shadow hides, cloudName is emptied, and Turn On Mode puts Land on This Cloud back. The next cloud the shadow touches starts it all again.
Two more boxes want care.
- Change Component Value’s Value starts empty. That’s the empty word the card means, so leave it.
- In Turn On Mode’s Event list, pick While Hitting Anything Tagged Cloud. Its Mode list comes next. Pick Land on This Cloud there.
event.otherName == self.shadowOnCloudsData.cloudName- Visible
No
- Component Value
self.shadowOnCloudsData.cloudName
- Event
While Hitting Anything Tagged Cloud- Mode
Land on This Cloud
5.7.2 The Planes’ Shadows
A plane’s shadow needs a Collider for one reason: it has to notice the clouds. Each touch runs Shadow on Clouds’ Collision Events.
Fighter Shadow is the one you started for the clouds. Finish it now. Its Collider meets only Tagged Cloud, and Shadow on Clouds goes under its Logic. Attaching it brings Shadow on Clouds Data along, which is the From Logic line on the card. Its Collision is Sensor, the middle of the Collider’s three Collision buttons, as on the Enemy Round in Chapter 4. A Sensor notices what it overlaps but never blocks it. At a Draw Order of -12, the shadow is drawn over the clouds and under every plane.
Zero Fighter Shadow is made the same way. Duplicate Fighter Shadow, type Zero Fighter Shadow in the copy’s Name box, and then change only its picture.
X 3, Y 3-12Fighter Shadow ArtX 3, Y 3SensorX 3, Y 3Collide Only WithTagged CloudPlane ShadowShadow on CloudsShadow on Clouds DataX 3, Y 3-12Zero Fighter Shadow ArtX 3, Y 3SensorX 3, Y 3Collide Only WithTagged CloudPlane ShadowShadow on CloudsShadow on Clouds DataLast, each plane gets Cast Shadow, with its own shadow and offsets under its Shared Variables.
X 3, Y 3Off30Fighter ArtX 3, Y 3X 0, Y -0.094X 0.656, Y 0.75Collide Only WithTagged Enemy Aircraft, Tagged Enemy Fire10.3131.31321.1887.18830Fighter Shadow0.844-1.313MG RoundX 3, Y 3Off20Zero Fighter ArtX 3, Y 3X 1.5, Y 1.125Collide Only WithFighter, Tagged Fighter RoundEnemy StatsData TableEnemy TypesEnemy AircraftExpressionobjectComponentProperty("self","dataStruct","health")ExpressionobjectComponentProperty("self","dataStruct","health")Enemy RoundFighterZero Fighter Shadow0.75-1.125Save, and run the game. Fly the Fighter up beside a cloud, or wait for one to drift down to it. A dark Fighter shape slides onto the cloud, down and to the right of the plane. Fly off over the sea, and it’s gone. When the V comes down over a cloud, five gray planes cross it with them.
In your game the shadow shows whole on the cloud. In the game at the top of this page, it stops clean at the cloud’s edge. That cut waits for the Mask Sprite block.
Every plane that joins the mission later gets its shadow the same way. It carries Cast Shadow. Its shadow wears the Tag Plane Shadow and carries Shadow on Clouds.
Watch for each of these. Your own game shows them all but one. The cut along a cloud’s edge is in the game at the top of this page, until Myth takes the Mask Sprite block.
- Islands, a destroyer and a carrier drift down at the sea’s own pace. They seem to sit on the water.
- A piece that leaves at the bottom comes back above the top, in its turn.
- Within half a minute, an island with huts and a jetty comes into view.
- Clouds drift down faster than the islands.
- A cloud that leaves at the bottom comes back at the top somewhere new.
- A few seconds in, a pale, see-through cloud slides over everything, the Fighter too.
- Each cloud has a gray shadow down and to its right, passing over the ships and the islands too.
- Fly beside a cloud. The Fighter’s shadow lies on it, cut along the cloud’s edge.
- Over open sea, the Fighter has no shadow at all.
- When the V passes over a cloud, its planes’ shadows cross the cloud with them.
The sea scenery rides the sea down and comes back above the piece it follows. The clouds drift faster and come back anywhere above the top. Every shadow is made by its owner and rides along with it. And a plane’s shadow shows only through a stencil cut from the cloud beneath it.
Underneath it all is depth that isn’t really there. Sky Ace is flat, one picture drawn in layers. The sea is at the bottom, then the sea scenery, the clouds’ shadows and the clouds. Over them come the planes’ shadows, the planes and the Fighter, and over everything the High Cloud.
Speed does the rest. The slower a thing slides, the farther away it looks.
5.8 If It Didn’t Work
Something may be a little off the first time. That’s normal. This chapter has many look-alike Objects, and one wrong picture hides well among them. Run the game, watch what it does, and think it through one piece at a time.
Your game won’t start, and a window says Can’t run yet? Open the Errors bar under the canvas. Perhaps Drift in Line’s Change Variable still holds the topEdge part, which waits for Myth. Then keep only @self.follows.transform.position.y.
No islands at all? Look for them in the Scene first. If they’re there but never move, look at Drift in Line’s first Event: 270 for the direction, and speed for the speed.
Two pieces land right on top of each other? Look at each one’s follows. Each should follow the piece that starts nearest below it, and Jungle Island follows Village Island. If those are right, look at Sea Scenery’s row names, each its Object’s name, letter for letter.
A piece leaves and never comes back? Look at Drift in Line’s second Event, When Leaving the View, and at its Set Position.
A cloud has no shadow? Look for Cast Shadow on that cloud, with its own shadow picked. Create Instance’s Object to Create should read @self.shadow. If the shadow stays behind while the cloud drifts on, look at Attach to Parent’s Parent list. It should read Its Creator.
No High Cloud at all? Look for it in the Scene, far above the window. It needs Drift and Return to bring it down.
The High Cloud is solid white? Set Opacity should be on it, with 0.42 for its opacity under Shared Variables. If it passes under the Fighter, its Draw Order should be 60.
Each of these is one small fix. Make it, run the game again, and you’re back with the chapter. And if you’d like to compare, the catch-up download in the Goal is this chapter’s game, finished.
The sky is yours to change now. One thing first: Chapter 6 starts from the cards’ values. So note what you change, and put it back before you go on. Or start Chapter 6 from this chapter’s catch-up download.
Move the sun. Give each cloud a negative offsetX under its Shared Variables, and their shadows fall to the left. Or make the High Cloud thicker or fainter with its opacity.
Or give the sea a seventh piece. Its row goes in Sea Scenery, and its place goes in the ring. Which piece should it follow, and which piece must follow it now?
Still stuck? Search the manual, or ask in the Myth Engine Discord (opens a new tab).
Your Fighter flies over a living sea now, and its shadow finds every cloud it meets. In Chapter 6, the mission gets its shape: four waves on a clock.
