← labopen lily’s rescue boats →

Lily’s Rescue Boats

All boats home. Lily’s lifeboat game, built from the concept boards (“Lily’s Rescue Boats”, “Lily’s Rescue Rangers”, “Little Boats”) and Sol’s write-up. Two ways to play, each on its own coast:

Her rules are the Rally, and everything the Service is built from:

> You will have a boat, and there are little people in tiny boats. There will be different colours of the tiny boats with the people inside. You have to steer the boat and try to go near enough, and then when you are near enough you will see them coming on to your boat. Try to get as many as you can and reach the finish line. > > There will be other boats in the sea, and when you get to the finish line the winner will be the one that rescued the most people. There are five of the big boats (the players), and there will be a 1st place, a 2nd place, a 3rd place, a 4th and a 5th place.

Why two: arrive fast, help slowly. A race for pickups rewards rushing past people; the Service rewards slowing down, coming close and holding steady while they climb aboard, so the game is about what the boards show. The race stays whole as the Rally, and Lily's 1st to 5th is still the Service's last word, as the crews' honours.

It shares no code with the original Rescue Race, which stays as it is: its own coast, rules, models and drawing.

The menu

The title is the boards' title card: your lifeboat charging along under the lighthouse's headland in the weather you've chosen (round a smooth loop worked out for each coast: out along the rocks, a wide slow turn, back further out, a wide turn home, leaning into the turns; the camera waits a little way ahead round the loop and eases after it, so the picture never jumps or starts over), the logo (All boats home under it), and the menu:

Playing

TouchKeys
steerput your finger anywhere on the sea and drag: ahead to go faster, to one side to turn, back to slow and back off (or the stick in a corner, if you've chosen it in Settings)the arrow keys, or WASD
stoplet golet go of the keys
sound the hornthe horn, bottom-right (your crew wave)
pausethe button top-leftescape

On the screen, laid out as on the boards' in-game view:

Coming alongside

Lily’s “near enough”, done the way a lifeboat does it:

How slow is slow enough depends on the level: under half of top speed on easy, under a third on hard. On easy and medium the boat eases off by itself as you come up to a little boat, so a quick drag toward it is enough. A ring in your colour round each little boat near you says “come alongside here”. If you're too fast, the screen says so.

The Rescue Service

A day on the lifeboats, three crews along one coast, out from their harbours and back.

The Rally

Lily's race, as she wrote it, on its own coast: the same boats, the same coming alongside. The crews race up a channel between the cliffs for the little boats and the places, to the harbour at the top. The weather stays as you chose it.

The finish

The coast

Each coast comes from a seed (on the line-up, and ?seed=), in two kinds that share its name, its harbour town and its granite.

The Service's:

The Rally's is a channel of open sea running north between granite cliffs:

One field says where the land is: the distance to the nearest shore, positive over water and negative on land. Everything is made from it, so nothing disagrees:

The weather

Picked on the line-up (?weather=), from the boards' weather panel: Calm, Windy, Foggy, Choppy, Night, plus the title card's sunset. Each one sets:

the seathe airand
☀️ sunnychoppy, whitecapsclear, cumulusgulls
🌤️ calma gentle swellcleargulls
💨 windybigger, steeper, foam streaks, spray flyingbroken cloud racinggulls
⛈️ stormyhigh and grey, the next boat lost behind a wavea lid of dark cloud, rainlightning and thunder; the beams turning
🌫️ foggymoderatethick fog, the coast lost in itlighthouse beams and your searchlight cut through; a foghorn
🌙 nightmoderatestars, the moon on the waterwindows lit, beams turning, your searchlight ahead
🌅 sunsetmoderatelow gold sun aheadthe sea and cliffs warm

The weather doesn't change the rules: every boat rides the same sea. In the Rally it stays as chosen; in the Service it's where the day starts, and the day goes on from there (above). The race keeps the sea to the day's weather itself, step by step (so a day runs the same without a page), and the page draws the rest from the same numbers.

The other boats

Each of the others (four in the Rally, the two neighbours' crews in the Service) is steered by the game:

The level sets how quick they are (and in the Service, the kind of boat: the inshore boat is about a sixth quicker than the lifeboat, the launch about a sixth slower):

In the Rally, on easy and medium, they ease off when well ahead of you and push on when behind.

How it's drawn

Its own WebGL2 renderer: the lab ships one bundle with no packages, so Three.js wasn't an option here. Lit like the boards:

The sea:

Cost on a phone (counted in the browser, a race in full swing): about 125 draw calls and 800k triangles a frame. That's within Sol's budget for draw calls, but the triangles want watching: the boulders and the ground are most of them.

client/rescue-coast/coast.tsthe coast from a seed (the Rally's or the Service's): the shore field, ground, islets, boulders, lighthouses, town, pier, station, buoys, the little boats and their people; the Service's three stations and the neighbours' harbours, its harbours' moored boats, and each station's calls
client/rescue-coast/race.tsthe rules: steering, the shore and other hulls, coming alongside, the line and the climb, the game's boats (flow fields over the water), the last call, the places; the Service's crews and kinds of boat, its calls, each station's stretch and helping in another's, landing at home, the search area
client/rescue-coast/weather.tsthe seven weathers, blending one into another, the Service's days
client/rescue-coast/waves.tsthe swell (CPU and GLSL)
client/rescue-coast/shapes.ts, models.tsmaking meshes; the lifeboat, the inshore boat, the harbour launch (and where people go aboard each), people, little boats, buoys, boulders, lighthouses, cottages, station, jetties, banner, gulls
client/rescue-coast/world.tsthe coast made drawable, in pieces along it
client/rescue-coast/render.ts, fx.tsthe drawing; wakes, spray, the line, the rings
client/rescue-coast/joystick.ts, sound.ts, main.tsthe stick (wherever you touch, or in a corner); the sounds; the page

Tests:

Addresses:

Not here yet, though the boards have them:

They're beyond Lily's two pages, and they'd come after the race itself looks and plays right.

Every picture (39)

The menu

The Rescue Service

Steering

Down the coast

Coming alongside

Out at sea

Home

The Rally

Looks

Weather