Skip to content

Tutorials · Physics and Mechanisms · Chapter 14

A gallery of physics

105 minutes Uses: Collider, CharacterBody, Area, Joint, RemoteTransform, Line, AnimatedSprite, StateMachine, Camera, Confiner, Signal, Sprite, TileMap, cut_jump, drop_down, emit, grounded, heard, jump, min, node, position, position_of, set_colour, set_flag, set_number, set_point, set_visible, vec2, vec4, velocity, wait

By the end

  • Two scenes of your own beside the tower, each started from an empty scene: a root, a Camera Confiner, a tilemap that New tilemap… names after the sheet and you rename, and the knight pasted in from the tower
  • A gargoyle whose body is Driven By its Script: gargoyle.rgs hops it with jump() and cut_jump(), spends its one air jump (Air Jumps 1) at the top of every third hop, and drops through its one-way perch with drop_down(), while its four body hooks count
  • A blade whose edge is an Area that names its clip’s Track, in the world only on the frames the blade is down, and round at its tips: a Capsule
  • A signpost whose board a Fixed joint holds crooked at its Weld Angle
  • A tavern sign swinging on a Pin with Turns Body, and its shadow cast on the wall by a Remote Transform that shade.rgs switches on and off as a lamp comes and goes
  • A lamp on a Target joint whose Target Point jumps between two hooks, where its Damping shows
  • A scale whose pan rides a Slider between its Min and Max stops on a Spring laid squashed: one crate leaves it at its top, two take it down and open a door
  • A crate puzzle seen from above: the knight and two crates Floating, a fence that is one Closed Line with Round corners on its own Sort Layer, a gate whose Collider has Solid off, a bell whose Circle Area rings for what comes through, and marks that fill with while_in
On this page

Two scenes beside the tower

The tower is finished. This chapter adds two scenes beside it, each with a tilemap of its own: scenes/gallery.ron, seen from the side as the tower is, and scenes/crate_puzzle.ron, a room seen from above. Each case in them is a small thing you know: a gargoyle, a blade, a crooked sign, a tavern sign and its shadow, a lamp, a scale, a pen of crates. Each sets something the tower leaves as it comes, so that by the end you have used every control the seven physics components have.

They are scenes of their own, not rooms of the tower: the crate puzzle’s knight floats, and the tower’s stands. To open one, open scenes in Assets and double-click gallery.ron or crate_puzzle.ron. Play plays the scene that is open. The tower stays the project’s first scene, so Run game still starts it.

The editor with gallery.ron open and its root, gallery, selected, framed whole at 91.6%: a long room under a mossy stone roof, a pen under a low slab at its west end with a plank across it and the gargoyle in it, the knight at his start east of the pen, a pillar hanging from the roof with a white window behind it, a signpost with a crooked board, a tavern sign hanging from a second pillar, a lamp on a thin rail, a round brick niche, two crates east of it, one on the floor and one on the pan over a pit with a coil in it, and a portcullis in the doorway of a wall near the east end; rose body boxes on the gargoyle, the knight and the crates. The Hierarchy lists confiner, backdrop, stone, perch, gargoyle, blade with blade_edge under it, sign_post, crooked_sign, sign_hook, tavern_sign, sign_shadow dimmed with a hidden eye, lamp_rail, knight with camera under him, lamp, crate_1, crate_2, pan, scale_base, scale_coil, scale_door and scale_contact
The gallery as this chapter leaves it: 896 by 256, its root selected and framed. The cases run west to east in the order this page builds them.

Making the gallery

A new scene is empty, and Save as… stays greyed until it holds a node. So the root comes first, named after the scene, and then the scene is saved under that name.

  1. Choose File › New scene, or press Ctrl+N. The Hierarchy is empty.
  2. Click + Add node and choose Node. Rename it gallery.
  3. Choose File › Save as…. In the dialog, open the project’s scenes folder, name the file gallery.ron, and save.
  4. Select gallery, click + Add node and choose Camera Confiner. Rename it confiner, set its Position to 448, 128, the room’s middle, and its Bounds to 896, 256, the room’s size. Until the camera arrives with the knight, confiner carries a warning, and Problems reads “This Confiner works on the active camera and this scene has no active Camera”: leave it.
  5. Select gallery and add a Sprite, backdrop. Drag art/old-dark-castle-interior-background.png onto Texture. Set Draw Mode to Tiled, Size to 896, 256, Tile Size to 960, 304, the picture’s own size, Anchor to 0, 0 and Sort Layer to -10, as the tower’s floors have it. Its Position stays 0, 0.
  6. Select gallery and add a Tilemap, stone.

The stone is a tilemap of its own, made from the same castle sheet as the tower’s.

  1. With stone selected, open the Tilemap tab beside the Inspector. Drag art/old-dark-castle-interior-tileset.png from Assets onto New tilemap…. The editor writes a new tilemap beside the sheet under the first name not already taken, and points stone at it. The tower’s tilemap has the sheet’s own name, so this one is art/old-dark-castle-interior-tileset-2.tilemap, and the status line at the foot of the window says so.
  2. Before you change anything in it, rename it: in Assets, right-click the new file, choose Rename, and type gallery.tilemap. stone still shows it.
  3. In the tab’s Tileset fold, set Margin y to 8.
  4. In the Layers fold, the new tilemap has two layers, back and ground; the second is the solid one. Double-click ground: its name turns into a box, the caret after the name. Press Ctrl+A to select the name, type stone, and press Enter. Then click stone, so it is the layer you paint on.
  5. Under Tools, click Rect. Choosing a tool turns on Paint mode at the top of the tab, as Brush would: a drag in the Viewport now paints, and selects nothing.
  6. Paint the room as the table below sets out. For each tile it names, hover the tiles in the picker at the tab’s foot until the tooltip reads its number, #490 for the roof’s first, and click it: the Tile line over the picker shows it. If the tiles are too small to hit, raise Zoom beside it. Drag over the cells the tile covers, from inside the first to inside the last: both corner cells are painted.
  7. A run of two tiles by turns, along a row or down a column, starts with its first two cells, painted one tile each. Then click Pick and drag over the two, click Stamp, and click the next cell along the run, and every second cell after it, to the run’s end; a cell left over at the end you paint on its own. Two rows by turns at once, as the roof’s cap and the stone under it, are a block two by two, picked and stamped the same way, each click on its top row.
  8. Press the tab’s Save, which writes the tilemap, and Ctrl+S for the scene.
The editor with gallery.ron open and stone selected and framed, the Tilemap tab open on the right: Paint mode and Save at its top; its Tools fold with Brush, Erase, Line, Rect, Fill, Pick, Stamp and Move; its Layers fold, 2 layers, back highlighted and stone under it, each at z 0; its Tileset fold with Sheet old-dark-castle-interior-tileset.png, Tile w 16 h 16, Columns 52, Margin x 0 y 8, Spacing x 0 y 0, Sheet 832x240, 728 tiles, 14 rows, and the sheet drawn small under it, then a grid of tiles at Zoom 2.0. The Viewport shows the gallery painted
The gallery’s tilemap in the Tilemap tab: its two layers, back and stone, and its Tileset with Margin x 0, y 8.
The gallery’s stoneRowsColumnsTiles, by the picker’s number (the sheet’s x, y)
The roof01 to 54the moss cap: #490 and #489 by turns, from #490 (336, 152 and 320, 152)
11 to 54the stone under the cap: #542 and #541 by turns, from #542 (336, 168 and 320, 168)
The west wall0 to 150the pillar’s body: #594 on the even rows and #646 on the odd (336, 184 and 336, 200)
The east wall0 to 1555the pillar’s body: #593 on the even rows and #645 on the odd (320, 184 and 320, 200)
The pen’s slab6 and 71 to 11as the roof: the cap on row 6, from #490, and the stone under it on row 7, from #542
The pen’s walls8 to 131 to 3, and 10 and 11the pillar’s body: on the even rows #594 in the odd columns and #593 in the even; on the odd rows #646 and #645 the same way
The blade’s pillar2 to 918 and 19the pillar’s body: #593 and #594 across on the even rows, #645 and #646 on the odd (320 and 336 across)
The tavern sign’s pillar2 to 526 and 27the same
The door’s wall2 to 1046 and 47the same
The floor’s slab14 and 151 to 42, and 46 to 54as the roof: the cap on row 14 and the stone on row 15, #490 and #542 in the odd columns, #489 and #541 in the even; the three columns between are the pit
Margin
The Tilemap tab’s Margin, in its Tileset fold: where the grid of tiles starts on the sheet, in pixels from its top-left corner. New tilemap… starts it at the corner, 0, 0, and the castle’s tiles are 8 lower: the pillar’s cap begins at the sheet’s y 152, which with no margin is half way down a row. With Margin y 8, every row of the pillar is a whole tile you can pick.
New tilemap…
The Tilemap tab’s button that makes a tilemap from the sheet dropped on it, beside the sheet, and points the selected Tilemap at it. It never overwrites: a name already taken gets -2, then -3. Rename the file before you paint: the tab keeps unsaved work under the name it opened the file by. A file’s id goes with it when it is renamed, so the node still finds it.

Then the knight, copied from the tower. A copy keeps every component he has, his camera, and his scripts’ fields.

  1. Double-click scenes/tower.ron in Assets. Select knight and press Ctrl+C.
  2. Double-click scenes/gallery.ron. Right-click gallery in the Hierarchy and choose Paste as child.
  3. Set the pasted knight’s Position to 232, 224: on the floor, east of the pen. Press Ctrl+S.

A hopping gargoyle

In the pen at the gallery’s west end, a gargoyle hops along by itself: small hops, and every third a high one that takes it up to the pen’s roof, from where it comes down onto a plank across the pen, sits a while, and drops through. Its body is walked and jumped by its own script, not by the keys.

  1. Select gallery and add a Sprite, perch, at Position 112, 190. Drag chapter 1’s art/scaffold-plank.png onto Texture, set Draw Mode to Tiled, Size to 96, 8, Tile Size to 48, 8, and Sort Layer to 1. Its Anchor stays 0.5, 0.5.
  2. Click Add component and choose ColliderComponent. Set its Size to 96, 8 and tick One Way, as chapter 1’s scaffolding has it.
  3. Select gallery and add a Sprite, gargoyle, at Position 112, 224. Drag art/gargoyle.png onto Texture, and set Size to 62, 56, Anchor to 0.5, 1 and Sort Layer to 2.
  4. Click Add component and choose CharacterBodyComponent. Set its Size to 40, 52, Driven By to Script, Gravity to 1200 and Jump Speed to 300. In its Jumping fold, set Jump Cut to 0.4 and Air Jumps to 1.

The plank runs across the whole pen, x 64 to 160, its top at y 186, 38 over the floor.

The Inspector, narrowed with its search box, character, to the gargoyle’s CharacterBodyComponent: Size 40.0 and 52.0, Motion Mode Grounded, Driven By Script, Velocity 0.0 and 0.0, Drift dim, Gravity 1200.00, Terminal Velocity 900.00, Speed 220.00, Jump Speed 300.00; the Jumping fold with Coyote Time 0.00, Jump Buffer 0.00, Jump Cut 0.40 and Air Jumps 1 on their sliders, Swim Stroke 0 and Rope Jump 0; the Slopes fold, Step Height 0, Floor Snap 0, Floor Max Angle 0.7854, Max Slides 1; the Pushing fold, Pushable unticked, Push Speed 0.50; Grounded, On Wall, Shoving, On Ceiling and Drop Through unticked; Layer World; Debug Color
The gargoyle’s body: Driven By Script, Gravity 1200, Jump Speed 300, Jump Cut 0.40, Air Jumps 1.
Driven By › Script
The Character Body’s Driven By, set to Script: the keys leave the body alone, and a script walks and jumps it. Its walk is its Velocity’s x, which the script writes every step with set_number; its jumps are asked for with jump(), and gravity, walls and floors still act as on the knight. Chapter 5’s crates are driven by a script that says nothing; the gargoyle’s says a lot.
Air Jumps
The Character Body’s Air Jumps, in its Jumping fold: how many jumps it may take in the air before it lands again, each a whole jump at its Jump Speed from wherever it is. A landing gives them back. 0, as it comes and as the knight keeps it, is no jump in the air; the gargoyle’s 1 is one, at the top of its high hop. A few suits a double or triple jump.
Jump Cut
The Character Body’s Jump Cut, as chapter 3 set the knight’s: the share of a rising jump’s speed kept when the jump is cut, from 0 to 1. Letting go of Space cuts the knight’s; cut_jump() cuts the gargoyle’s. At 0.4, a hop cut the step after it leaves the ground rises 9 where a whole jump rises 35.
Gravity and Jump Speed
The Character Body’s Gravity, in units a second each second, and Jump Speed, the speed a jump leaves with, in units a second. The gargoyle’s 1200 and 300 make a heavy, low hop: a whole jump rises 35, under the pen’s roof. The knight’s are 2000 and 680.
Size
The Character Body’s Size, on the gargoyle: 40 by 52, its stone body inside its 62 by 56 picture, without the wings’ tips.
One Way
The Collider’s One Way, as chapter 1’s scaffolding has it: a body rises up through it from below and lands on it from above. The perch’s top is 38 over the pen’s floor, 3 over the top of a whole jump.

The script asks for a jump every step it stands, cuts two hops in three as they leave the ground, and at the top of the third asks for one more: its air jump. Its body’s four hooks keep count, and its perch, picked in the Inspector, tells a landing on the plank from one on the floor.

  1. In Assets, click Create, choose New script, type gargoyle and press Enter. In the Code tab, replace everything in gargoyle.rgs with the script below, and press Ctrl+S.
  2. Select gargoyle, click Add component and choose Gargoyle. Leave Speed and Rest as the script gives them. Click the picker button beside Perch and click perch in the Hierarchy. Press Ctrl+S.
rgs gargoyle.rgs
/// The gargoyle. It hops along its pen by itself: small hops, each cut short
/// as it leaves the ground, and every third a high one, an air jump at its
/// top that takes it up to the pen's roof, past its perch, a one-way plank
/// across the pen: it comes down on the perch, sits there a while, and drops
/// through it. A wall turns it round. Its body's hooks keep count, and the
/// Inspector shows the counts as it plays.
component Gargoyle : Body {
    /// How fast it hops along.
    #[suffix("u/s")]
    speed: f32 = 60.0,
    /// How many steps it sits on its perch before it drops through it.
    #[suffix("steps")]
    rest: i32 = 30,
    /// Its perch: the one-way plank it sits on.
    #[node_path]
    perch: i32 = 0,
    /// Which way it hops: 1 east, -1 west.
    #[readonly]
    way: f32 = 1.0,
    /// Its hops so far.
    #[readonly]
    hops: i32 = 0,
    /// Whether this hop is a high one.
    #[readonly]
    high: bool = false,
    /// Whether this hop's air jump is spent.
    #[readonly]
    spent: bool = false,
    /// Whether it sits on its perch.
    #[readonly]
    perched: bool = false,
    /// How many steps it has sat there.
    #[readonly]
    sat: i32 = 0,
    /// How many times it has dropped through its perch.
    #[readonly]
    drops: i32 = 0,
    /// How many times it has landed.
    #[readonly]
    landings: i32 = 0,
    /// How many walls it has met.
    #[readonly]
    walls: i32 = 0,
    /// How many times it has met the roof.
    #[readonly]
    bumps: i32 = 0,

    fn loop() {
        set_number("CharacterBodyComponent", "velocity.x", way * speed);
        if perched {
            sat += 1;
            if sat >= rest {
                drop_down();
            }
        } else if grounded() {
            jump();
        } else if high && !spent && velocity().y >= 0.0 {
            jump();
            spent = true;
        }
    }

    fn on_leave_ground() {
        if perched {
            perched = false;
            high = false;
            drops += 1;
        } else {
            hops += 1;
            high = hops % 3 == 0;
            if !high {
                cut_jump();
            }
        }
    }

    fn on_land() {
        landings += 1;
        spent = false;
        sat = 0;
        perched = position().y < position_of(node(perch)).y;
    }

    fn on_hit_wall() {
        walls += 1;
        way = -way;
    }

    fn on_hit_ceiling() {
        bumps += 1;
    }
}
component Gargoyle : Body
A script with a Body base: it goes on a node with a Character Body, and it hears the body’s four hooks below, besides loop. Its fields are drawn in the Inspector; the #[readonly] ones (attributes) are counts you watch, not boxes you type into.
#[node_path]
Gives a field a picker in the Inspector, beside it, that you point at a node: Perch keeps the node picked. In the script, node(perch) is that node.
on_leave_ground
Runs the step after its body leaves the ground, whether it jumped or dropped. The gargoyle counts a hop there and cuts it, or counts a drop when it was sitting on its perch.
on_land
Runs the step its body lands. The gargoyle counts the landing, gives its air jump back to its own count, and asks where it landed.
on_hit_wall
Runs when its body’s walk is stopped by a wall. The gargoyle turns its Way round, so it hops back the other way the next step.
on_hit_ceiling
Runs when its body’s rise is stopped by a ceiling: the gargoyle’s head on the pen’s roof. It only counts it.
jump
Asks its body to jump, as Space asks the knight’s, by its Coyote Time, Jump Buffer and Air Jumps: standing, it jumps; in the air, it jumps only while it has an air jump left.
cut_jump
Cuts a rising jump to its Jump Cut’s share, as letting go of Space does. Called in on_leave_ground, a step after the jump, it makes a small hop.
velocity and grounded
Read its body as the step began: its Velocity, and whether it stands. velocity().y turned from rising (under 0, since y grows downward) to 0 or more is the top of a jump.
drop_down
Drops its body through the one-way plank it stands on, as S with Space drops the knight. On solid ground or in the air it does nothing. A drop leaves the ground as a jump does, so on_leave_ground hears it too, falling rather than rising.
set_number
Writes a number onto another component of this node. "velocity.x" is one half of the Character Body’s Velocity: the gargoyle’s walk, 60 units a second either way.
position and position_of
position() is this node’s place in the world: the gargoyle’s feet. position_of(node(perch)) is the perch’s, the middle of the plank. Landed with its feet above that, it is on the perch.

Its small hops are cut a step after they leave the ground and rise 9. Every third is a whole jump, which rises 35. The pen’s roof is 96 over its floor; standing, the gargoyle’s head is 44 under it, so a whole jump stops 9 short. At its top, where velocity().y turns downward, the script asks again, and its one air jump throws it up from there, up past its perch, to the roof. The perch is 3 over a whole jump’s top, so only the air jump takes the gargoyle past it, and from the roof it comes down on it. On the perch it walks on along the plank, counting out its Rest, 30 steps, half a second; then drop_down(), and it falls through to the floor. A wall turns it round.

  1. Select gargoyle, so the Inspector shows its counts while the game runs, and press F5. The pen is just west of the knight, in the game camera’s view.
  2. Watch ten seconds: small hops, and every third the high one to the roof, down onto the perch, a moment’s sit and a drop through. Hops, Drops, Landings, Walls and Bumps go up as it plays. Press F5 to stop.
Six frames of the gargoyle’s pen, close up, its plank perch across the middle with a thin green line along its top, the brick wall behind and the roof’s stone along the top: in the first the gargoyle is just off the floor, in front of the plank, a small rose arrow pointing east from its rose box; in the second it is at the top of a high hop, its feet just under the plank’s top, an arrow pointing west; in the third it is up against the roof, its feet well over the plank; in the fourth it stands on the plank; in the fifth it is falling through the plank, a long rose arrow pointing down and west; in the sixth it is on the floor again, an arrow pointing east
Steps 8, 43, 46, 60, 86 and 96 (0.13, 0.72, 0.77, 1.00, 1.43 and 1.60 s), the editor in Play at 200%, framed on the perch, no key pressed: a small hop, 9 up; the top of a whole jump, 3 under the perch’s top; its air jump on step 45 takes it to the roof on 46; it lands on the perch on step 52 and sits there walking west; drop_down() on step 82 drops it through, and it lands on the floor on 96.
The Inspector, narrowed with its search box, gargoyle, to the Gargoyle script in Play: Speed 60.00 u/s, Rest 30 steps, Perch perch, then dim: Way -1.00, Hops 21, High ticked, Spent unticked, Perched unticked, Sat 0, Drops 6, Landings 26, Walls 11, Bumps 6
Step 600 of the same run (10.00 s), gargoyle selected: 21 hops, 6 of them up to the roof (Bumps) and down onto the perch, 6 drops through it, 26 landings and 11 walls met, at x 84 and 140 in turn.

Try it: no air jump, no cut, no drop

  1. Select gargoyle and set its Air Jumps to 0. Press F5: the high hop’s second jump() is nothing, and it never reaches the roof, nor its perch, 3 over a whole jump. Press F5 to stop and set Air Jumps back to 1.
  2. Set its Jump Cut to 1. Press F5: the cut keeps all of the rise, and its small hops go up as high as a whole one. Stop, and set Jump Cut back to 0.4.
  3. In gargoyle.rgs, delete the line drop_down(); and press Ctrl+S. Press F5: the first time it comes down on its perch it stays there for good, walking the plank from wall to wall. Stop, put the line back, and press Ctrl+S.

With Jump Cut at 1 a small hop rises 35, the whole jump’s height, since the cut keeps all of it.

A guillotine blade

Hung from the pillar east of the knight, a blade chops down out of the stone and back up, over and over. Its edge catches him only while the blade is down. The blade is an Animated Sprite whose one clip moves its picture down and up; its edge is an Area on a node of its own that names a track of that clip, and is in the world only on the frames the track covers.

  1. Select gallery, click + Add node and choose Animated Sprite. Rename it blade and set its Position to 304, 160: the foot of its pillar.
  2. In its Sprite, drag art/blade.png onto Texture, and set Size to 28, 42, Anchor to 0.5, 1 and Sort Layer to -1: behind the stone, so the blade is hidden while it is up in its pillar.

The clip is one picture, the whole blade, shown five times. Only each frame’s pivot moves it: the pivot is the point of the frame that sits on the node, so a pivot higher up the picture draws the blade lower.

  1. Double-click art/blade.png in Assets. The Sprite sheet tab opens on it. Under Grid, set Cell to 28 and 42, the picture’s own size, and click cell 0, 0: Selected 1 x 1.
  2. Under Clips, press From selection. Name the clip chop, choose Loop, and press Generate 1. A file, art/blade.anim, appears beside the picture.
  3. Select blade. In its Animated Sprite, drag art/blade.anim onto Animations, type chop into Clip, and tick Frame Size. Speed stays 1 and Playing ticked.
  4. Open the Animation tab in the dock under the Viewport, and drag the border above the dock up to give it room. In the clip’s ruler, right-click its one frame and choose Hold this frame. Do it three more times: each makes a copy, so five frames now each show the whole picture.
  5. Under Frames, give each frame its seconds in dur and its pivot in pivot x and y, as the table below says, moving from one frame to the next with the transport row’s next-frame button.
  6. Under the frame strip, type edge into Track name, choose Active, and press Add track. In the edge row of the grid, click the third cell: frame 2, counting from 0, the frame the blade is down. Press Save, and Ctrl+S.
Framedur, in secondsPivot x, yWhere the blade is
00.80.5, 1up in its pillar
10.050.5, 0.5half way down
20.50.5, 0.143down, its edge at y 196, 2 into his head
30.150.5, 0.33going back up
40.150.5, 0.67nearly up
The Animation tab on blade, Atlas 28x42, with Save: one clip, chop (5), Loop chosen, 1.25 fps and Free; the transport row reading Frame 1 / 5, 1.65s; the edge track in the grid, its third of five cells orange; the frame strip with Frame 0, dur 0.800, pivot x 0.50, y 1.00, its region 28 by 42 at 0, 0, every frame 0.800 and mixed, 5 frames, 1.65s total; the Track name box with Active chosen and Add track; a Slice row and the sheet below
The blade’s clip: chop, five frames, Loop, 1.65 s round; its edge track Active on frame 2 alone. (The Slice row under it is the tab’s own, untouched.)

The edge is a node of its own under the blade: a node whose Area names a track is hidden by the clip on every frame the track does not cover, and a hidden node’s Area notices nothing. On its own node, it is the edge that is hidden, not the blade’s picture.

  1. Select blade, click + Add node and choose Node. Rename it blade_edge and set its Position to 0, 28, under the blade’s node.
  2. Click Add component and choose AreaComponent. Open its Shape, set Kind to Capsule and Size to 28, 16: the crescent’s width, round at its tips. Click the button beside Mask, untick World and tick Knight. Type edge into Track.
  3. In Assets, click Create, choose New script, type edge and press Enter. Replace everything in edge.rgs with the script below, and press Ctrl+S.
  4. Select blade_edge, click Add component and choose Edge. Press Ctrl+S.
The Inspector, narrowed with its search box, area, to blade_edge’s AreaComponent: the Shape fold, 12 fields, with Kind Capsule and Size 28.0 and 16.0 bright with dots, Outline 0 items, Step 32.00 u dim, Offset 0.0 and 0.0, and Solid, One Way, Layer 1, Include Layers 0, Exclude Layers 0 and Material dim; then the Area’s own Layer World, Mask Knight and Track edge
The edge’s Area: a Capsule 28 by 16, Mask Knight, Track edge.
rgs edge.rgs
/// The blade's edge. Its Area names the blade's `edge` track: it notices
/// only on the frames of the blade's chop that the track covers, when the
/// blade is down. It counts each time it catches the knight.
component Edge : Area {
    /// How many times it has caught him.
    #[readonly]
    hits: i32 = 0,

    fn on_enter() {
        hits += 1;
    }
}
Track
The Area’s Track: the name of an event track of the clip its node’s Animated Sprite plays, on its own node or one above it. Named, the Area is in the world only on the frames that track covers, and its node is hidden on the rest. Empty, as it comes, the Area is always in the world. Chapter 4 left it empty; the edge names edge.
Kind › Capsule
The Area’s Shape › Kind set to Capsule: a box rounded at its two ends by half its height, along its longer side. A Rectangle, as it comes, notices anything that reaches its box; a capsule leaves out the box’s corners, so the edge’s tips are round, as a crescent’s are.
Size
The Area’s Shape › Size: its box, in world units. For a capsule, its length and its thickness: the edge’s 28 by 16 is round at each end with a radius of 8.
Mask
The Area’s Mask: the layers it notices, as chapter 4 set the plate’s. The edge notices the knight’s layer alone.
Active
An event track’s kind in the Animation tab: on while the clip shows a frame the track covers, a state held across those frames. A Trigger fires once as its frame begins. An Area’s Track reads an Active one.
component Edge : Area
A script with an Area base, like chapter 4’s plate: on_enter runs when something its Area notices comes into it. The edge counts each time it catches him in Hits.
  1. Select blade_edge, so the Inspector shows its Hits, and press F5. Hold D until the knight is under the blade, and let go.
  2. Stand there four seconds. Each time the blade comes down, its edge catches him once, the step it comes down, and Hits goes up by one; while it is up, nothing, though he stands under it the whole time. Press F5 to stop.
Four frames of the blade’s pillar and the knight under it, close up, a white leaded window behind: in the first the blade is hidden in the dark pillar and the knight has just stopped under it, his cape still flying; in the second the grey crescent blade hangs half way down out of the pillar; in the third it is down over his head, a thin yellow capsule outline drawn round its crescent; in the fourth it is going back up, its outline gone; small blue squares mark the selected edge’s corners in every frame
Steps 30, 50, 52 and 83 (0.50, 0.83, 0.87 and 1.38 s), the editor in Play at 200%, framed on the signpost, blade_edge selected: D held from step 0 to 27 stands him under the blade. The clip’s first frame holds to step 48 and its second from 49 to 51; its third, the one the edge track covers, from step 52 to 81, and the edge is in the world, its capsule drawn, only then; its fourth from 82. It caught him on step 52, and catches him again on 151 and 250, 99 steps, one chop, apart.
The game: the knight standing under the blade’s pillar, the grey crescent blade down over his head, a white leaded window behind; east of him the signpost with its board nailed on crooked, its arrow pointing east; up to the right the tavern sign hanging from its hook, turned, and a dark shadow of it on the wall below and west of it
The game’s own window on step 52 (0.87 s), the step the blade comes down on him: D held from step 0 to 27.

The edge is a Capsule, and its middle line is 6 over his head, so under the blade he is caught. But stood at a tip, his head grazing only the corner of the box round the edge, he is outside the round, and the blade comes down past him. Walked a step at a time east from under it, a whole chop at each, he is caught at x 320, his box 0.8 into the round; at 322.7 his box is still inside the box round the edge, 1 outside its round, and it is not.

Try it: no track, and a square edge

  1. Select blade_edge and empty its Track. Press F5 and hold D as before: the edge is always in the world, and it catches him once, as he walks under it, and never again however often the blade comes down. Stop, and type edge back into Track.
  2. Select knight and set his Position to 322.7, 224: under the edge’s east tip. Select blade_edge, press F5, and press nothing: the blade comes down past him, and Hits stays 0. Stop.
  3. Set the edge’s Shape › Kind to Rectangle. Press F5: each time the blade comes down, the square edge catches him at the same stand, and Hits goes up by one. Stop, set Kind back to Capsule, and set the knight’s Position back to 232, 224.

At x 322.7 his box is inside the box round the edge and 1 outside its round tip. The stands where the square catches him and the round does not make a band about one step of his walk wide, so a tap of D may step over it: the try-it sets his Position instead.

A crooked sign

East of the blade, a signpost holds a board nailed on crooked. The board is drawn straight and turned by a weld: a Fixed joint holds it at its target’s turn plus a Weld Angle, on its nail, every step, against its own weight.

  1. Select gallery and add a Sprite, sign_post, at Position 352, 224. Drag art/sign-post.png onto Texture, and set Size to 8, 40, Anchor to 0.5, 1 and Sort Layer to 1.
  2. Select gallery and add a Sprite, crooked_sign, at Position 366, 194. Drag art/sign-crooked.png onto Texture, and set Size to 32, 16 and Sort Layer to 2. Leave its Rotation at 0: it is drawn straight.
  3. Click Add component and choose CharacterBodyComponent: Size 4, 4, Driven By Script.
  4. Click Add component and choose JointComponent. Set Kind to Fixed, type sign_post into Target, set Target Anchor to 14, -30, where on the post it is nailed, and Weld Angle to -17.19. Press Ctrl+S.
The Inspector, narrowed with its search box, jointcomponent, to crooked_sign’s JointComponent: Kind Fixed, Target sign_post, Anchor 0.0 and 0.0, Target Anchor 14.0 and -30.0 with a dot; Target Point, Axis and Length dim; Weld Angle -17.19° bright with a dot; Turns Body, Stiffness and Damping dim; Enabled ticked; the Limits and Motor folds dim; Break Stretch 0.00 u and Break Twist 0°
The board’s weld: Fixed to the post at Target Anchor 14, -30, its Weld Angle -17.19°.
Kind › Fixed
The Joint’s Kind for a weld, as chapter 8’s lantern has it: it holds its Anchor on its Target Anchor and its node turned at the target’s turn plus Weld Angle, set true again each step. The post never turns, so the board is held at the Weld Angle itself.
Weld Angle
The Joint’s Weld Angle, which only a Fixed joint reads: how far the weld holds its node turned from its Target, in degrees in the Inspector. 0, as it comes and as the lantern keeps it, is turned as the target is. The board’s -17.19 (-0.3 of a radian, as the scene file keeps it) tips its west end down. A few degrees reads as a crooked nail.
Target Anchor
The Joint’s Target Anchor: its end on the post, in the post’s own units from its node, the post’s foot. 14, -30 is 30 up the post and 14 east of it, where the board’s middle is laid.

Saved straight, the board is turned crooked on the very first step of Play, and held there.

Three frames of the signpost close up, at 400%, a white window behind: in the first the board, an arrow pointing east painted on it, is drawn straight across the top of the post, a pale blue box round it and an orange cross with the word Fixed at its middle; in the second and third the board is turned, its west end down and its east end up, the blue box turned with it, the cross on its middle
Steps 0, 1 and 60 (0.00, 0.02 and 1.00 s), the editor in Play at 400%, framed on the signpost, crooked_sign selected: drawn straight as saved, crooked from step 1, and held there.

Try it: a square weld

  1. Select crooked_sign and set its Joint’s Weld Angle to 0.
  2. Press F5: the board hangs square on its post. Press F5 to stop.
  3. Set Weld Angle back to -17.19.
Two frames of the signpost close up: the board straight across the top of the post in both, the blue box and the orange cross on it
For comparison, with Weld Angle typed 0: steps 0 and 60 (0.00 and 1.00 s), framed as the strip above. The weld holds the board as the post is turned: square.

A tavern sign and its shadow

Under the second pillar hangs a tavern sign on a hook, swinging. When the lamp beside it, built in the next section, hangs by it, the sign casts a shadow on the wall behind, down and west of it, turned and sized as the sign is. The shadow is a picture of its own; a Remote Transform on the sign puts it there, and a script on the sign switches the Remote Transform on and off.

  1. Select gallery, click + Add node and choose Node. Rename it sign_hook and set its Position to 432, 96: the foot of its pillar.
  2. Select gallery and add a Sprite, tavern_sign. Drag art/swing-sign.png onto Texture, and set Size to 32, 28 and Sort Layer to 1. Set its Scale to 1.5, 1.5, its Rotation to 20 and its Position to 425.8436, 112.9145: its ring on the hook, the sign let go 20° out.
  3. Click Add component and choose CharacterBodyComponent: Size 8, 8, Driven By Script, Gravity 300.
  4. Click Add component and choose JointComponent. Leave Kind at Pin. Type sign_hook into Target, set Anchor to 0, -18, and tick Turns Body.
  5. Click Add component and choose RemoteTransformComponent. Type sign_shadow into Target. Position stays ticked; tick Rotation and Scale. Set Offset to -10, 8, and untick Enabled.
  6. Select gallery and add a Sprite, sign_shadow, at Position 415.8436, 120.9145. Drag art/swing-sign-shadow.png onto Texture, and set Size to 32, 28 and Sort Layer to -2, behind the sign. Leave it unturned at its own size, and untick its Visible.
  7. In Assets, click Create, choose New script, type shade and press Enter. Replace everything in shade.rgs with the script below, and press Ctrl+S.
  8. Select tavern_sign, click Add component and choose Shade. Click the picker beside Shadow and click sign_shadow in the Hierarchy. Press Ctrl+S.
The Inspector, narrowed with its search box, remote, on tavern_sign: its RemoteTransformComponent with Target sign_shadow, Position ticked, Rotation and Scale ticked with dots, Offset -10.0 and 8.0 with a dot, Enabled unticked with a dot; under it the Shade script with Shadow sign_shadow
The sign’s Remote Transform: onto sign_shadow, its place, turn and size, by Offset -10, 8, saved switched off; the Shade script under it.
rgs shade.rgs
/// The tavern sign's shadow. The lamp's `lit` switches on the Remote
/// Transform on this node, which puts the shadow where the sign is, by its
/// Offset, turned and sized as the sign is, every step; and it shows the
/// shadow. The lamp's `dark` switches both off. A step that hears both ends
/// lit.
component Shade {
    /// The shadow: the node the Remote Transform copies onto.
    #[node_path]
    shadow: i32 = 0,

    fn on_signal() {
        if heard("dark") {
            set_flag("RemoteTransformComponent", "enabled", false);
            set_visible(node(shadow), false);
        }
        if heard("lit") {
            set_flag("RemoteTransformComponent", "enabled", true);
            set_visible(node(shadow), true);
        }
    }
}
Anchor and Turns Body
The Joint’s Anchor, on the sign: 0, -18 is its ring, 12 over its middle times its Scale of 1.5. With Turns Body ticked, a Pin is a hinge: it holds the ring on the hook and the sign’s middle the Anchor’s length from it, wherever the swing has it, and turns the sign to hang from its ring, as chapter 7’s bob hangs from its pivot.
Gravity
The Character Body’s Gravity, on the sign: 300, light, so a swing there and back takes about 1.5 s, as a pendulum 18 long takes under that gravity, 2π√(18 ÷ 300) = 1.54 s: the strip below has it back on step 92, 1.53 s.
The Remote Transform’s Target
The node the sign’s Remote Transform copies the sign onto: sign_shadow, typed by name.
The Remote Transform’s Position
Whether it copies the sign’s place onto the shadow. It comes ticked, and the sign keeps it so: the shadow goes where the sign is, by the Offset.
The Remote Transform’s Rotation
Whether it copies the sign’s turn. Ticked, the shadow swings as the sign does.
The Remote Transform’s Scale
Whether it copies the sign’s size. Ticked, the shadow is drawn half as big again as its own picture, because the sign is: its Scale is 1.5. It comes unticked.
The Remote Transform’s Offset
Added to the copied place, in world units: -10, 8 sets the shadow 10 west of the sign and 8 lower, on the wall behind, as a lamp up and east of it would throw it. It comes 0, 0.
The Remote Transform’s Enabled
Whether it copies right now. The sign’s is saved unticked, and shade.rgs ticks it when the lamp says lit and unticks it at dark. Unticked, the shadow stays wherever it was last left.
set_visible
Shows or hides a node: set_visible(node(shadow), true) shows the shadow picked in Shadow. A Remote Transform copies place, turn and size, never whether a node is shown, so the script does both.
set_flag
Ticks or unticks a box on another component of this node: set_flag("RemoteTransformComponent", "enabled", true) ticks the Remote Transform’s Enabled. The Remote Transform is on the sign, so the sign’s script switches it.

The shadow waits for the lamp. Build it next, then play the two together.

A lamp that snaps between hooks

A lamp hangs from a rail running east from the tavern sign’s pillar, and every two seconds it snaps from one hook to the other. It is a body on a Target joint, as chapter 9’s claw was: a joint that pulls its body toward a point in the world, its Target Point. The claw’s script walked its point smoothly; the lamp’s script makes it jump 80 at once, and there the joint’s Damping shows.

  1. Select gallery and add a Node, lamp_rail, at Position 528, 100.
  2. Click Add component and choose LineComponent. Under Points, press + twice and set the two to -80, 0 and 56, 0: from the sign’s pillar east. Set Width to 2 and Color to 0.08, 0.09, 0.1, alpha 1. Leave Joint at Flat, and set Sort Layer to 1.
  3. Click knight in the Hierarchy and press Ctrl+Down until he is just under lamp_rail: nine times, each one slot down among the gallery’s nodes. The lamp and the scale are built after him, as the picture at the top of the page lists them.
  4. Select gallery and add a Sprite, lamp, at Position 488, 100. Drag chapter 8’s art/lantern.png onto Texture, and set Size to 14, 22, Anchor to 0.5, 0, hung by its ring, and Sort Layer to 2.
  5. Click Add component and choose CharacterBodyComponent: Size 4, 4, Driven By Script, Gravity 0.
  6. Click Add component and choose JointComponent. Set Kind to Target, Target Point to 488, 100, Stiffness to 0.05 and Damping to 0.03.
  7. In Assets, click Create, choose New script, type lamp and press Enter. Replace everything in lamp.rgs with the script below, and press Ctrl+S. Select lamp, click Add component and choose Lamp; its Near, Far and Stay stay as the script gives them.
  8. Click Add component and choose SignalComponent. Add two connections, as chapter 4’s plate has them: Signal lit, To tavern_sign, and Signal dark, To tavern_sign. Press Ctrl+S.
The Inspector, narrowed with its search box, jointcomponent, to the lamp’s JointComponent: Kind Target; Target dim, reading (none); Anchor 0.0 and 0.0; Target Anchor dim; Target Point 488.0 and 100.0 with a dot; Axis, Length, Weld Angle and Turns Body dim; Stiffness 0.05 and Damping 0.03 on their sliders, each with a dot; Enabled ticked; the Limits fold with Use Limits unticked; the Motor fold dim; Break Stretch 0.00 u, and Break Twist 0° dim
The lamp’s Target joint: its Target Point on the near hook, 488, 100, a soft Stiffness of 0.05, Damping 0.03.
rgs lamp.rgs
/// The lamp. The Target on this node pulls it toward its Target Point, a hook
/// on its rail: this snaps that point from one hook to the other and back,
/// and the lamp swings across after it. It says `lit` as it goes to the hook
/// by the tavern sign, and `dark` as it leaves it; its Signal wires both to
/// the sign.
component Lamp {
    /// The hook by the sign, where its light casts the sign's shadow.
    near: Vec2 = vec2(488.0, 100.0),
    /// The hook away from it.
    far: Vec2 = vec2(568.0, 100.0),
    /// Seconds it stays on each hook.
    #[suffix("s")]
    stay: f32 = 2.0,

    fn loop() {
        set_point("JointComponent", "target_point", near);
        emit("lit");
        await wait(stay);
        set_point("JointComponent", "target_point", far);
        emit("dark");
        await wait(stay);
    }
}
Target Point
The Joint’s Target Point, which only a Target reads: where it pulls its body, in world units. Saved on the near hook, 488, 100; lamp.rgs sets it to the far hook, 568, 100, and back.
Stiffness
The Joint’s Stiffness: the share of the way to its point a Target pulls each pass, from 0 to 1. The lamp’s 0.05 is soft: after its point jumps, the lamp swings across to it over a few dozen steps, as the strip below shows.
Damping
The Joint’s Damping: the share of its body’s speed each pass takes off, from 0 to 1. Chapter 9’s claw walked its point slowly and its Damping hardly showed. Here the point jumps: at 0.03 the lamp swings 27 past the far hook and is settled on it within 29 steps. A new Joint’s is 0.1.
Gravity
The Character Body’s Gravity, on the lamp: 0. Nothing but its joint moves it.
Points, Width and Color
The Line’s, as chapter 13’s rope has them: the rail’s two points, 136 apart along the line from the pillar east, in the node’s own units; a stroke 2 thick; and a dark iron colour.
Joint › Flat
The Line’s Joint as it comes: its ends square, and nothing laid on its corners. The rail is open, two ends and no corner, so it is one bar with square ends.
Sort Layer
The Line’s Sort Layer: the rail’s 1 draws it over the wall and the stone, and under the lamp on 2.
set_point
Writes a pair of numbers onto another component of this node at once: set_point("JointComponent", "target_point", far) moves the joint’s Target Point to the far hook in one step. The script moves the point, never the lamp.
emit and wait
emit("lit") says lit, which the lamp’s Signal carries to tavern_sign, where shade.rgs hears it. await wait(stay) holds the loop on that line for Stay seconds, 2, before it carries on.

The lamp and the sign in Play

  1. Select lamp and press F5. Move the pointer over the Viewport and press F to frame the lamp, with the tavern sign beside it.
  2. Watch the lamp: two seconds on the near hook, then its point jumps to the far hook and the lamp swings across after it, past the hook, back, and settles. Two seconds later it swings back.
  3. Watch the sign: it swings on its hook, 20° each way, for good. While the lamp is on the near hook, its shadow swings with it on the wall, faint on the dark stone; while the lamp is away, the shadow is gone. Press F5 to stop.
Five frames of the lamp’s rail, a thin grey bar along the top, close up: in the first the lamp hangs at the rail’s west hook, the word Target over it and a thin orange line from it to an orange cross at the east hook; in the second the lamp has swung past the cross to the east; in the third it has swung back west of the cross; in the fourth it is a little east of it again; in the fifth it hangs on the cross; a blue box round the lamp each time
Steps 122, 128, 137, 143 and 152 (2.03, 2.13, 2.28, 2.38 and 2.53 s), the editor in Play at 200%, framed on the rail, lamp selected, no key pressed: its script sets the point on the far hook, the cross, on step 122; the lamp is 27 past it on step 128, 5.7 short on 137, 2.5 past on 143, and on the hook from about step 151.
Five frames of the tavern sign on its hook, close up, the word Pin and an orange cross over the hook, its ring in a rose box and a pale blue box round the sign: in the first it hangs turned one way, its east end low; in the second it hangs level; in the third it is turned the other way; in the fourth it is back as in the first; in the fifth it is turned again; in the second, third and fourth a faint dark shape lies on the wall below and west of the sign, darkening the vines there, which in the first and fifth are bright
Steps 0, 23, 45, 92 and 150 (0.00, 0.38, 0.75, 1.53 and 2.50 s), the editor in Play at 200%, framed on the rail, tavern_sign selected, no key pressed: let go 20° out, level on step 23, 20° the other way on 45, back on 92. The lamp says lit on step 1, and the shadow is shown from step 2 and on the sign from 3; the lamp says dark on step 122, the shadow is hidden from 123, and on step 150 the sign swings alone.
Three frames of the tavern sign close up, at 400%, hanging nearly level, with the lamp’s orange line and the grey rail across the top: in the first no shadow is drawn; in the second a pale blue box, the shadow’s outline, is turned steeply over the sign’s west half, a dark tilted shape inside it on the wall; in the third the blue box is level, down and west of the sign, the shadow behind it
Steps 487, 488 and 489 (8.12, 8.13 and 8.15 s), the editor in Play at 400%, framed on the sign’s hook, sign_shadow selected so its outline is drawn while it is shown, no key pressed: hidden, the step the lamp says lit; shown where it was left at the last dark, on step 365, when the sign was turned about 18°; on the sign by its Offset, level as the sign is.

Try it: no damping, a lot of damping

  1. Select lamp and set its Joint’s Damping to 0. Press F5 and press F over the Viewport: the lamp swings further past the far hook, and is longer settling. Stop.
  2. Set Damping to 0.3. Press F5: the lamp creeps onto each hook and never passes it. Stop, and set Damping back to 0.03.

With no Damping the lamp swings 39 past the far hook and takes 50 steps to settle, against 27 and 29 at 0.03; at 0.3 it never passes the hook, and settles in 9.

Five frames of the lamp’s rail, as the strip above: the lamp at the west hook; swung further past the cross than before, near the frame’s east edge; swung back further west of the cross; east of it again; still a little short of it
For comparison, with Damping typed 0: the same steps, 122, 128, 137, 143 and 152, framed as the strip above: 39 past on step 128, 16 short on 137, 9 past on 143, still swinging on 152; on the hook from about step 172.

Try it: the sign without a hinge, the shadow at its own size

  1. Select tavern_sign and untick its Joint’s Turns Body. Press F5: the pin holds the sign’s middle straight under the hook, the board still turned as it was saved, and it does not swing. Stop, and tick Turns Body again.
  2. Untick its Remote Transform’s Scale. Press F5: the shadow is its picture’s own size, smaller than the sign. Stop, and tick Scale again.

A scale that opens a door

At the gallery’s east end, a pan lies flush with the floor over a pit, a crate on it, against a door. One crate does not weigh it down; the knight shoves a second crate onto it beside the first, and the two take it down to a stop, where a contact under it opens the door.

  1. Double-click scenes/tower.ron, select chapter 5’s crate_1 and press Ctrl+C. Double-click scenes/gallery.ron, right-click gallery and choose Paste as child. The copy keeps its name, crate_1: set its Position to 724, 224.
  2. Right-click gallery and choose Paste as child again. This copy is named crate_1 too: rename it crate_2 and set its Position to 640, 224: on the floor, west of the pit.
  3. Select gallery and add a Sprite, pan, at Position 712, 232. Drag art/scaffold-plank.png onto Texture, and set Size to 48, 8 and Anchor to 0.5, 1: its top at 224, flush with the floor.
  4. Click Add component and choose CharacterBodyComponent: Size 46, 8, Driven By Script. Then a ColliderComponent: Size 48, 8, Offset 0, -4. Then an AreaComponent: its Shape Size 48, 8, Offset 0, -4, and its Mask set to nothing: the contact below looks for the pan, not the other way.
  5. Click Add component and choose JointComponent. Set Kind to Spring, type scale_base into Target, and set Length to 84 and Stiffness to 0.003. Damping stays 0.1.
  6. Select gallery and add a Node, scale_base, at Position 712, 256, the pit’s foot. It comes after pan in the Hierarchy.
  7. Click Add component and choose JointComponent. Set Kind to Slider and type pan into Target. Axis stays 0, 1. Tick Use Limits, and set Min to 16 and Max to 24.
  8. Select gallery and add a Sprite, scale_coil, at Position 712, 256. Drag chapter 9’s art/spring-coil.png onto Texture, and set Size to 16, 20, Anchor to 0.5, 1 and Sort Layer to 1: in the pit, under the pan.
  9. Select gallery and add a Sprite, scale_door, at Position 752, 176, in the doorway: chapter 4’s portcullis again. Drag art/portcullis.png onto Texture, set Draw Mode to Tiled, Size to 32, 48, Tile Size to 16, 48, Anchor to 0.5, 0 and Sort Layer to -1. Add a ColliderComponent, Size 32, 48, Offset 0, 24, and chapter 4’s Door script.
  10. Select gallery and add a Node, scale_contact, at Position 712, 240, where the pan’s foot is at its bottom stop. Add an AreaComponent with its Shape Size 40, 3; its Mask stays World, the pan’s Area’s layer. Add chapter 4’s Plate script, and a SignalComponent: Signal pressed, To scale_door, and Signal released, To scale_door. Press Ctrl+S.
The Inspector, narrowed with its search box, jointcomponent, to the pan’s JointComponent: Kind Spring, Target scale_base, Anchor and Target Anchor 0.0 and 0.0; Target Point and Axis dim; Length 84.00 with a dot; Weld Angle and Turns Body dim; Stiffness 0.003 and Damping 0.10 on their sliders; Enabled ticked; the Limits fold with Use Limits dim; the Motor fold dim; Break Stretch 0.00 u, Break Twist 0° dim
The pan’s Spring to the base: Length 84, Stiffness 0.003.
The Inspector, narrowed with its search box, jointcomponent, to scale_base’s JointComponent: Kind Slider, Target pan, Anchor and Target Anchor 0.0 and 0.0, Axis 0.0 and 1.0; Target Point, Length, Weld Angle, Turns Body, Stiffness and Damping dim; Enabled ticked; the Limits fold with Use Limits ticked, Min 16 and Max 24 with dots; the Motor fold with Use Motor unticked, Speed 60 u/s and Max Step 4.0 u; Break Stretch 0.00 u, and Break Twist 0° dim
The base’s Slider up to the pan: its stops, Min 16 and Max 24.
Kind › Spring and Slider
The Joint’s Kind, as chapter 9’s board and lift have them: a Spring pushes and pulls its ends toward Length apart, by Stiffness; a Slider holds its Target on a line along Axis and, with Use Limits, between Min and Max along it. A Spring does not read the limits; a Slider does. So the pan has both, on two nodes.
Use Limits
The Joint’s Use Limits: ticked on the base’s Slider, it keeps the pan’s height over the base, along Axis, between Min and Max.
Min
The Joint’s Min: the near end of a Slider’s range, in world units, shown only with Use Limits ticked. The base’s 16 is the pan’s bottom stop, 8 under the floor.
Max
The Joint’s Max: the far end of the range. The base’s 24 is the pan’s top stop, its top flush with the floor.
Length
The Joint’s Length, on the pan’s Spring: how far apart it pushes its ends, in world units. 84 is over three times the 24 it is laid at, so the spring is squashed: it presses the pan up against its top stop, and what stands on the pan must outweigh that before the pan moves.
Stiffness
The Joint’s Stiffness, on the Spring: how hard it pushes toward its Length, from 0 to 1. 0.003 is very soft; squashed by 60, it is still enough to hold one crate up.
Axis
The Joint’s Axis, on the Slider: the way its line runs from the base, 0, 1, down, as it comes. Along it, the pan’s height over the base is its measure.

The base comes after the pan in the Hierarchy, so its Slider is solved after the Spring each step, and the pan ends each step on a stop or between them. One crate does not outweigh the spring: as saved, the pan stays at its top, the door shut.

  1. Select pan and press F5. Hold D: the knight walks east to crate_2 and shoves it east onto the pan, beside crate_1. Let go of D when the two crates meet.
  2. Hold A a moment to walk him back off the pan. The two crates take it down to its bottom stop, the contact under it says pressed, and the door goes up. Press F5 to stop.
Four frames of the gallery’s east end, close up: in the first the knight, his rose arrow pointing east, meets the second crate on the floor, while the first crate stands on the pan, flush with the floor, a pale blue box round the pan, the coil in the pit under it and the portcullis shut in the doorway at the right; in the second he shoves the second crate onto the pan against the first; in the third he walks back west, a long rose arrow pointing west, and the pan with both crates on it is a little lower; in the fourth the pan is down at its bottom stop under the floor’s top, both crates on it, the knight standing west of it, faint between two pictures, and the portcullis is raised into the wall, only its spikes showing, the doorway open
Steps 210, 236, 250 and 262 (3.50, 3.93, 4.17 and 4.37 s), the editor in Play at 200%, framed on the coil, pan selected: D held from step 60 to 238, then A from 238 to 258. The second crate meets the first on step 236; the pan is at its bottom stop, 16.6 over its base, by step 259, and the door is up.

Try it: a stop the contact cannot feel, a weaker spring

  1. Select scale_base and set its Joint’s Min to 18. Press F5 and shove the second crate on as before: the pan stops 2 higher, the contact never feels it, and the door stays shut. Stop, and set Min back to 16.
  2. Select pan and set its Joint’s Length to 64. Press F5: the saved crate alone sinks the pan, and the door opens at once. Stop, and set Length back to 84.

The crate puzzle

The second scene is a room seen from above, 24 cells by 18, a wall of the pillar’s body all round, the floor the camera’s own dark. In its north-east corner, behind a fence, is a pen with two marks on its floor where two crates belong. The knight floats: seen from above there is no down.

  1. Choose File › New scene. Add a Node, rename it crate_puzzle, and choose File › Save as…: scenes/crate_puzzle.ron.
  2. Select crate_puzzle and add a Camera Confiner, confiner, at Position 192, 144, with Bounds 384, 288. Until the camera arrives with the knight, confiner carries a warning, and Problems reads “This Confiner works on the active camera and this scene has no active Camera”: leave it.
  3. Select crate_puzzle and add a Tilemap, stone. In the Tilemap tab, drag the castle’s tileset onto New tilemap…: this time the file is art/old-dark-castle-interior-tileset-3.tilemap, since the gallery’s tilemap kept the id the -2 name gave it, so that name is not free. Rename it crate-puzzle.tilemap in Assets.
  4. Set the Tileset Margin y to 8. In the Layers fold, double-click ground, press Ctrl+A, type stone, and press Enter; then click stone, so you paint on it.
  5. Click Rect, which turns on Paint mode, and paint the wall round the room as the table below sets out, as you painted the gallery’s: each tile by its number in the picker, and a run of two by turns with Pick and Stamp. Press the tab’s Save, and Ctrl+S.
The puzzle’s stoneRowsColumnsTiles, by the picker’s number (the sheet’s x, y)
The north wall00 to 23the pillar’s body: #593 and #594 by turns, from #593 (320, 184 and 336, 184)
The west wall1 to 160#645 on the odd rows and #593 on the even (320, 200 and 320, 184)
The east wall1 to 1623#646 on the odd rows and #594 on the even (336, 200 and 336, 184)
The south wall170 to 23#645 and #646 by turns, from #645 (320, 200 and 336, 200)

The floor inside runs from x 16 to 368 and y 16 to 272. The pen is x 224 to 368, y 16 to 112. Its marks and its fence come first; the crates and the knight, pasted from the gallery, come after them.

The marks

A mark is a dim decal on the floor with an Area that looks for crates. While a crate stays on it, its script fills it, and its picture brightens.

  1. In Assets, click Create, choose New script, type mark and press Enter. Replace everything in mark.rgs with the script below, and press Ctrl+S.
  2. Select crate_puzzle and add a Sprite, mark_1, at Position 296, 30: straight up from where the gate will be, its top edge on the north wall’s face. Drag art/floor-mark.png onto Texture, set Size to 28, 28 and Sort Layer to 1, a decal on the floor, and its Color’s alpha to 0.3, dim.
  3. Add an AreaComponent: Shape Size 20, 20, Mask Crate. Add the Mark script; its Fill stays 1.
  4. Duplicate mark_1, rename the copy mark_2, and set its Position to 236, 52: against the pen’s west side. Press Ctrl+S.
rgs mark.rgs
/// A mark where a crate belongs. Its Area looks for crates. While a crate
/// stays on it the mark fills, a step's share of its Fill seconds every step,
/// and its picture brightens from dim to whole as it does. A crate shoved off
/// leaves it as full as it got.
component Mark : Area {
    /// Seconds a crate must stay on it to fill it.
    #[suffix("s")]
    fill: f32 = 1.0,
    /// How full it is, from 0 to 1.
    #[readonly]
    filled: f32 = 0.0,

    fn while_in() {
        filled = min(filled + dt / fill, 1.0);
        set_colour("SpriteComponent", "color", vec4(1.0, 1.0, 1.0, 0.3 + 0.7 * filled));
    }
}
while_in
The third hook of a script with an Area base, beside on_enter and on_exit: it runs every step another Area is still on this one, with other and the step’s dt. The step a crate comes on is an on_enter’s step, and Mark has none, so nothing happens yet; from the next step, every step the crate stays, while_in fills the mark by the step’s length ÷ Fill: with Fill 1 s, a sixtieth of the way each step.
dt
The step’s length in seconds, 1 ÷ 60 at the project’s sixty steps a second. while_in and loop are given it; on_enter is not.
set_colour, vec4 and min
set_colour writes a colour onto another component of this node, here the Sprite’s Color, red, green, blue and alpha, vec4(…). Its alpha goes from the 0.3 it was saved with to whole as Filled goes to 1; min(…, 1.0) stops Filled at 1.

The fence, its gate and its bell

The fence round the pen is one Line: closed, so it runs all round; round at its corners; on a Sort Layer of its own between the marks and the crates. Under it are its solid sides, a gate that is not solid, its posts and a bell.

  1. Select crate_puzzle and add a Node, fence. Its Position stays 0, 0, so every place under it is the world’s.
  2. Click Add component and choose LineComponent. Under Points, press + four times and set them to 224, 18; 366, 18; 366, 112; and 224, 112. Set Width to 3, Color to 0.22, 0.12, 0.05, alpha 1, Joint to Round, tick Closed, and set Sort Layer to 2.
  3. Select fence and add four Nodes, each with a ColliderComponent: fence_west at Position 224, 65, its Collider Size 4, 98; fence_south_1 at 248, 112, Size 48, 4; fence_south_2 at 344, 112, Size 48, 4; and gate at 296, 112, Size 48, 4. In the gate’s Collider, untick Solid.
  4. Select fence and add five Sprites, the posts: drag art/fence-post.png onto each one’s Texture, and set Size to 8, 24, Anchor to 0.5, 1 and Sort Layer to 3. post_1 at 224, 18 and post_2 at 224, 112, the west side’s ends; post_3 at 272, 112 and post_4 at 320, 112, the gate’s sides; post_5 at 366, 112, the pen’s south-east corner.
  5. In Assets, click Create, choose New script, type bell and press Enter. Replace everything in bell.rgs with the script below, and press Ctrl+S.
  6. Select fence and add a Sprite, gate_bell, at Position 344, 114: hung under the fence’s south side, east of the gateway. Drag chapter 13’s art/bell.png onto Texture, and set Size to 32, 34, Anchor to 0.5, 0 and Sort Layer to 4.
  7. Add an AreaComponent. Open its Shape: Kind Circle, Size 48, 48, Offset -48, -2, round the gateway and centred in it. Set its Mask to Knight and Crate. Add the Bell script. Press Ctrl+S.
The Inspector, narrowed with its search box, line, to the fence’s LineComponent: Points, 4 items, 224.0 18.0, 366.0 18.0, 366.0 112.0 and 224.0 112.0; Width 3.00; Color a brown swatch; Joint Round; Closed ticked; Sort Layer Custom 2; each with a dot
The fence’s Line: four Points, Width 3, Joint Round, Closed, Sort Layer 2.
The Inspector, narrowed with its search box, collider, to the gate’s ColliderComponent: Kind Rectangle, Size 48.0 and 4.0, the Polygon fold with Outline 0 items and Step 32.00 u, Offset 0.0 and 0.0, Solid unticked with a dot, One Way unticked, Layer World, Include Layers Nothing, Exclude Layers Nothing, Material unticked
The gate’s Collider: as the fence’s sides, but with Solid unticked.
The Inspector, narrowed with its search box, area, to gate_bell’s AreaComponent: the Shape fold with Kind Circle, Size 48.0 and 48.0, Outline 0 items, Step 32.00 u, Offset -48.0 and -2.0, and Solid, One Way, Layer 1, Include Layers 0, Exclude Layers 0 and Material dim; then the Area’s own Layer World, Mask Knight, Crate, and an empty Track
The bell’s Area: a Circle 48 across, Offset -48, -2 into the gateway, Mask Knight and Crate.
rgs bell.rgs
/// The bell by the pen's gate. Its Area reaches across the gateway: each
/// thing that comes into it, the knight or a crate, rings it — it swings
/// over — and is counted.
component Bell : Area {
    /// How many times it has rung.
    #[readonly]
    rung: i32 = 0,

    fn on_enter() {
        rung += 1;
        set_flag("SpriteComponent", "flip.x", rung % 2 == 1);
    }
}
Closed
The Line’s Closed, ticked on the fence: its last point joins back to its first, so four points draw all four sides of the pen. Unticked, as it comes and as the rail and chapter 13’s rope keep it, the line has two ends.
Joint › Round
The Line’s Joint set to Round: a disc on every corner, the joining one too, so the corners show no gap at a slant. Flat, as the rail has it, puts nothing there; RoundCaps, the rope’s, rounds its two ends as well.
Sort Layer
The Line’s Sort Layer on the fence: 2, over the marks on 1, so where mark_2 runs under the fence’s west side the fence is on top, and under the posts and the crates on 3 and the knight. Set to 0, it goes under them: a try-it below.
Points, Width and Color
The Line’s, on the fence: its four corners in the world’s units, since fence sits at the origin; a stroke 3 thick; a dark wood.
Solid
The Collider’s Solid, unticked on the gate: a Collider with Solid off stops nothing and notices nothing. It is not a trigger, as it would be in Unity or Godot, and no script hears it. The gate is a swing gate saved open, the fence’s Line drawn across it shut; what notices what comes through is the bell’s Area beside it. The fence’s sides keep Solid ticked, as it comes.
Kind › Circle
The Area’s Shape › Kind set to Circle: round, its radius the smaller half of its Size, 24, centred where the box would be. What is inside the box round the circle but outside the circle, near its corners, is not noticed.
Offset
The Area’s Shape › Offset: where its shape sits from its node, in world units. The bell hangs east of the gate, so -48, -2 moves its reach west, into the gateway.
Mask
The Area’s Mask on the bell: Knight and Crate, so it rings for him and for each crate.
component Bell : Area
Rings for each thing that comes into its Area: on_enter counts it in Rung and turns its picture over with set_flag("SpriteComponent", "flip.x", …), so the bell swings from one side to the other.

The crates and the knight

The crates and then the knight go last, after the fence, as the Hierarchy in the picture of the finished puzzle below lists them. Each step the bodies move in the order the Hierarchy lists them, and a crate takes a shove as it next moves, so their order decides on which step a shoved crate goes.

  1. Double-click scenes/gallery.ron in Assets, select crate_1 and press Ctrl+C. Double-click scenes/crate_puzzle.ron.
  2. Right-click crate_puzzle in the Hierarchy and choose Paste as child. The copy keeps its name, crate_1: set its Position to 296, 176, under the gate.
  3. Right-click crate_puzzle and choose Paste as child again. This copy is named crate_1 too: rename it crate_2 and set its Position to 296, 232, under the first.
  4. In each crate, set its Sprite’s Sort Layer to 3 and its Character Body’s Motion Mode to Floating. Press Ctrl+S.
  5. Double-click scenes/gallery.ron, select knight and press Ctrl+C. Double-click scenes/crate_puzzle.ron, right-click crate_puzzle and choose Paste as child. Set his Position to 296, 268, and in his Character Body set Motion Mode to Floating. Select his camera and set its Position to 0, -15, his middle. Press Ctrl+S.
The Inspector, narrowed with its search box, character, to the puzzle knight’s CharacterBodyComponent, its first rows: Size 12.0 and 30.0, Motion Mode Floating with a dot, Driven By Keys, Velocity 0.0 and 0.0, Drift dim
The puzzle’s knight: Motion Mode Floating.
Motion Mode › Floating
The Character Body’s Motion Mode set to Floating: it has no down. Its Gravity is not applied, it never stands, and every surface is a wall to it. A Keys body walks all four ways at its Speed, W north and S south as A and D west and east, and stays where it is when let go of. A Floating crate is shoved both ways too, and stays where the shove leaves it. Grounded, as it comes, is the tower’s.
The editor with crate_puzzle.ron open and stone selected, framed at 149.6%: a square room walled in dark green stone, black inside; in its north-east corner the pen, a brown fence drawn all round with rounded corners, five wooden posts on it, two dim dashed square marks inside it, one at the north wall and one against the west side; a thin olive circle across the gateway in the fence’s south side; a brass bell hanging under the fence east of the gateway; two crates in a column below the gateway, in rose boxes, and the knight at the bottom under them. The Hierarchy lists confiner, stone, mark_1, mark_2, fence with fence_west, fence_south_1, fence_south_2, gate, post_1 to post_5 and gate_bell under it, crate_1, crate_2, and knight with camera under him; the Inspector shows stone’s TileMapComponent, crate-puzzle.tilemap
The crate puzzle as this chapter leaves it, framed by its stone. The circle is the bell’s Area, drawn by the Triggers gizmo.

The puzzle in Play

  1. Press F5. Hold W: the knight shoves the column of crates north through the gate, until the first is against the north wall, on mark_1. Let go.
  2. Hold D until he is clear of the second crate’s east side, then W to line him up beside it: his head north of the second crate’s south side, and not north of its north side, 1 to 8 steps of W from where the row left him. S brings him back if he goes too far.
  3. Hold A: he shoves the second crate west until the fence’s side stops it, on mark_2. Press F5 to stop.
Six frames of the pen and the room under it, from above: in the first the two crates stand in a column below the gateway, the knight below them, the two dim marks in the pen and the thin circle across the gateway; in the second he shoves the column north, the first crate through the gateway inside the circle, his cape flying; in the third the first crate is against the north wall on the first mark, the second under it in the pen, him under that; in the fourth he stands east of the second crate, a rose arrow pointing north; in the fifth he shoves it west, orange and rose arrows pointing west; in the sixth it stands on the second mark against the fence’s west side, him beside it
Steps 0, 60, 111, 129, 150 and 175 (0.00, 1.00, 1.85, 2.15, 2.50 and 2.92 s), the editor in Play, framed on the stone: W held from step 0 to 111, D from 111 to 121, W from 121 to 129, then A from 129. The first crate is on its mark, against the north wall, from step 110; the second stops against the fence’s west side, on its mark, at x 238.
Four frames of the first mark at the north wall, close up at 400%: in the first the dim dashed square mark is empty, a thin yellow square inside it, a crate coming up from below; in the second, third and fourth a crate stands on the mark, and the mark’s dashes showing round the crate brighten from dull olive to bright yellow
Steps 90, 110, 130 and 160 (1.50, 1.83, 2.17 and 2.67 s), the editor in Play at 400%, framed on mark_1, W held from step 0 to 111: empty; the crate comes on about step 95, and while_in fills the mark every step from the next; whole after a second, 61 steps, it stays whole.
Five frames of the gateway and the bell close up, the fence along the top with two posts at the gateway’s sides, the thin circle across the gateway, the bell hanging under the fence east of it, a crate at the lower left: the knight walks north under the east post, outside the pen, a rose arrow pointing up from him; in each frame his head is higher, nearer the circle’s south-east edge; in the fifth his head is inside the circle, and the bell is turned over, its light slope on the other side
Steps 40, 48, 49, 52 and 53 (0.67, 0.80, 0.82, 0.87 and 0.88 s), the editor in Play at 200%, framed on post_4: D from step 0 to 10 takes him under the gate’s east post, outside the pen, then W walks him north beside it. On step 48 his head is just short of the box round the circle; from step 49 to 52 his box is inside that box and outside the circle, and the bell is still; on step 53 it comes into the circle, and the bell rings.

Try it: a latched gate, an open fence, a square bell, a mark that fills once

  1. Select gate and tick its Collider’s Solid. Press F5 and hold W: the gate is latched, and the crates stop against it. Stop, and untick Solid.
  2. Select fence and untick its Line’s Closed. Press F5: the fence’s west side is gone from the picture, though its Collider still stands. Stop, and tick Closed. Set its Sort Layer to 0 and look at mark_2: it now covers the fence’s west side. Set Sort Layer back to 2.
  3. Select gate_bell and set its Shape › Kind to Rectangle. Press F5, hold D until he stands under the gate’s east post, outside the pen, and walk him north a step at a time with Pause and Step and W held: it rings four steps sooner than the circle did, while he is still beside the post, out of the gateway. Stop, and set Kind back to Circle.
  4. In mark.rgs, write on_enter for while_in, and (1.0 / 60.0) for dt, which only while_in is given, and press Ctrl+S. Press F5 and shove the first crate onto its mark: it fills a sixtieth and stops. Stop, put the script back as it was, and press Ctrl+S.

Who moves what

The gallery is no floor’s way up. The tower is unchanged from chapter 13: by the keys, from his start, the whole climb still takes 2755 steps, 45.9 s.

The gallery and the puzzle, node by node

NodeComponentFieldValue
confinerPosition448, 128
Camera ConfinerBounds896, 256
backdropSpriteTexture, Draw Modeold-dark-castle-interior-background.png, Tiled
Size, Tile Size896, 256; 960, 304
Anchor, Sort Layer0, 0; -10
stoneTilemapTilemapgallery.tilemap
perchPosition112, 190
SpriteTexture, Draw Modescaffold-plank.png, Tiled
Size, Tile Size, Sort Layer96, 8; 48, 8; 1
ColliderSize, One Way96, 8; ticked
gargoylePosition112, 224
SpriteTexture, Sizegargoyle.png, 62, 56
Anchor, Sort Layer0.5, 1; 2
Character BodySize, Driven By40, 52; Script
Gravity, Jump Speed1200, 300
Jump Cut, Air Jumps0.4, 1
GargoylePerchperch
knightPosition232, 224, pasted from the tower
NodeComponentFieldValue
bladePosition304, 160
SpriteTexture, Sizeblade.png, 28, 42
Anchor, Sort Layer0.5, 1; -1
Animated SpriteAnimations, Clipblade.anim, chop
Frame Sizeticked
blade_edgePosition0, 28, under blade
AreaShape › Kind, SizeCapsule, 28, 16
Mask, TrackKnight; edge
Edgeedge.rgs
sign_postPosition352, 224
SpriteTexture, Sizesign-post.png, 8, 40
Anchor, Sort Layer0.5, 1; 1
crooked_signPosition366, 194
SpriteTexture, Size, Sort Layersign-crooked.png, 32, 16; 2
Character BodySize, Driven By4, 4; Script
JointKind, TargetFixed, sign_post
Target Anchor, Weld Angle14, -30; -17.19
NodeComponentFieldValue
sign_hook(a Node)Position432, 96
tavern_signPosition, Rotation425.8436, 112.9145; 20
Scale1.5, 1.5
SpriteTexture, Size, Sort Layerswing-sign.png, 32, 28; 1
Character BodySize, Driven By, Gravity8, 8; Script; 300
JointKind, TargetPin, sign_hook
Anchor, Turns Body0, -18; ticked
Remote TransformTargetsign_shadow
Position, Rotation, Scaleticked, ticked, ticked
Offset, Enabled-10, 8; unticked
ShadeShadowsign_shadow
sign_shadowPosition, Visible415.8436, 120.9145; unticked
SpriteTexture, Size, Sort Layerswing-sign-shadow.png, 32, 28; -2
lamp_railPosition528, 100
LinePoints-80, 0; 56, 0
Width, Color2; 0.08, 0.09, 0.1, alpha 1
Joint, Sort LayerFlat; 1
lampPosition488, 100
SpriteTexture, Sizelantern.png, 14, 22
Anchor, Sort Layer0.5, 0; 2
Character BodySize, Driven By, Gravity4, 4; Script; 0
JointKind, Target PointTarget, 488, 100
Stiffness, Damping0.05, 0.03
Lamplamp.rgs
Signallit, darkeach to tavern_sign
NodeComponentFieldValue
crate_1, crate_2Position724, 224; 640, 224, pasted from the tower
panPosition712, 232
SpriteTexture, Size, Anchorscaffold-plank.png, 48, 8; 0.5, 1
Character BodySize, Driven By46, 8; Script
ColliderSize, Offset48, 8; 0, -4
AreaShape › Size, Offset48, 8; 0, -4
MaskNothing
JointKind, TargetSpring, scale_base
Length, Stiffness84, 0.003
scale_basePosition712, 256, after pan
JointKind, TargetSlider, pan
Use Limits, Min, Maxticked, 16, 24
scale_coilPosition712, 256
SpriteTexture, Sizespring-coil.png, 16, 20
Anchor, Sort Layer0.5, 1; 1
scale_doorPosition752, 176
SpriteTexture, Draw Modeportcullis.png, Tiled
Size, Tile Size32, 48; 16, 48
Anchor, Sort Layer0.5, 0; -1
ColliderSize, Offset32, 48; 0, 24
Doordoor.rgs
scale_contactPosition712, 240
AreaShape › Size40, 3
Plateplate.rgs
Signalpressed, releasedeach to scale_door
NodeComponentFieldValue
confinerPosition192, 144
Camera ConfinerBounds384, 288
stoneTilemapTilemapcrate-puzzle.tilemap
mark_1, mark_2Position296, 30; 236, 52
SpriteTexture, Sizefloor-mark.png, 28, 28
Color, Sort Layer1, 1, 1, alpha 0.3; 1
AreaShape › Size20, 20
MaskCrate
Markmark.rgs
fenceLinePoints224, 18; 366, 18; 366, 112; 224, 112
Width, Color3; 0.22, 0.12, 0.05, alpha 1
Joint, Closed, Sort LayerRound, ticked, 2
fence_westColliderPosition; Size224, 65; 4, 98
fence_south_1, fence_south_2ColliderPosition; Size248, 112 and 344, 112; 48, 4
gateColliderPosition; Size296, 112; 48, 4
Solidunticked
post_1 … post_5Position224, 18; 224, 112; 272, 112; 320, 112; 366, 112
SpriteTexture, Sizefence-post.png, 8, 24
Anchor, Sort Layer0.5, 1; 3
gate_bellPosition344, 114
SpriteTexture, Sizebell.png, 32, 34
Anchor, Sort Layer0.5, 0; 4
AreaShape › Kind, SizeCircle, 48, 48
Shape › Offset-48, -2
MaskKnight, Crate
Bellbell.rgs
crate_1, crate_2Position296, 176; 296, 232
SpriteSort Layer3
Character BodyMotion ModeFloating
knightPosition296, 268
Character BodyMotion ModeFloating
cameraPosition0, -15

The first four tables are gallery.ron, every node under gallery, blade_edge under blade; the last is crate_puzzle.ron, the fence’s sides, posts and bell under fence. The crates are chapter 5’s, and the knight is the tower’s, pasted. Every other field is as it comes.

Check it works