Games & entertainment
Game development
- Text
BenchClub / canyon-glide
Canyon glide
A toon-shaded game in three.js: glide a paper bird down a sunset canyon, ride visible wind and fly through 12 rings of light to the finish
Task
Build a small game that runs in the browser: I glide a paper bird down a canyon at sunset, ride the wind and fly through rings of light to a finish line.
Make it beautiful, like a frame from an animated film. Design your own canyon within the art direction below.
PRIORITIES
- Art direction. It has to look beautiful in a still screenshot and in motion. A plain, default-looking result fails however well it works.
- Everything under FOR CHECKING works exactly as written.
- A steady frame rate on a laptop.
SETUP
- This folder contains
three.module.js(Three.js r170). Copy it unchanged todist/three.module.js. - Write everything else into one file,
dist/index.html. Import Three.js withimport * as THREE from './three.module.js'. - No other libraries, and no three.js addons: write any post-processing yourself, with render targets and full-screen shaders. No downloaded models, textures, fonts or audio. No network requests. Everything is generated in code.
- Every piece of text the work shows (titles, labels, counters, hints, buttons) is in English.
- The page will be opened in desktop Chrome from a local web server (http://localhost:8000/index.html) in a 1920x1080 window. It should hold a steady frame rate on a laptop.
REFERENCES (look at these before you design) If you can reach the web while you build, find images of each and look at them closely; otherwise work from the descriptions. Take the ideas named, never copy their assets. In review.md, write one line per reference: what you took from it.
- Alto's Odyssey: sunset gradients, layered silhouettes that get paler with distance, a tiny figure in a vast landscape.
- Journey (thatgamecompany): warm low sun on stone, glowing cloth, sand and dust catching the light.
- Monument Valley: clean faceted forms, a strict pastel palette, every frame composed like a poster.
ART DIRECTION
- Palette, by role: sky top #3B3473, sky middle #E07A6E, horizon and fog #F2A27C, sun #FFE6B0, lit rock #E8A06A, mid rock #C8613F, rock in shadow #6B3A5A (violet, never black), river #9DB0E6, paper #FFF7EA with a #F07A5A underside, rings #FFF0C2 with a #FFC77A glow. Nothing outside it.
- Light: a low sun #FFC996, 10 to 15° above the horizon, ahead and to the left of the course, so one wall is lit warm and the other falls into violet shadow; a hemisphere fill, sky #8A78D0 and ground #4A2230.
- Fog: linear, colour #F2A27C, from about 50 m to about 400 m, so the far canyon melts into the sky.
- Materials: MeshToonMaterial with a 3-step gradient map (nearest filtering) for rock and paper; strata bands as vertex colours on the walls; an inverted-hull outline or a rim light on the bird; rings unlit, with an additive glow.
- Camera: a 60 to 65° field of view, 12 to 15 m behind and 4 to 6 m above the bird, looking about 10 m ahead of it, rolling with the bird's bank by up to 15°.
- Post, written by hand: a bloom on the rings and the sun (bright pass above about 0.8, blur, add back); a warm grade; a vignette of about 0.3; a light film grain.
MUST NOT LOOK LIKE
- default grey materials: MeshStandardMaterial left at its defaults, MeshNormalMaterial, unlit flat colours;
- flat ambient-only light, with no key light, shadows or contrast;
- a black or empty void around the scene;
- primitives (boxes, spheres, cylinders) sitting on a plane;
- debug helpers: axes, grids, light or camera helpers, stats panels, GUI sliders;
- canyon walls made of boxes or a straight extruded strip;
- a bird that is a cone, an arrow or a flat triangle.
THE CANYON
- One winding course from a start to a finish line, between rock walls much higher than the bird can climb, with a riverbed below.
- Toon shading: surfaces lit in a few flat bands, not smooth plastic shading. Fog colours the distance.
- The sun is low, the sky is a sunset gradient, and something besides the bird moves: drifting dust, sparkles, birds far off.
- At least 12 rings of light along the course, glowing, placed so that following them leads to the finish.
- At least three wind currents along the course that I can see (streaks, ribbons or particles moving with the wind). Flying through one pushes the bird the way it blows: an updraft lifts it.
- A clear finish line: an arch or a gate.
THE FLIGHT
- The bird is folded paper: flat facets, creases, paper colours. Its wings flex as it glides.
- I see it from behind; the camera follows smoothly, leans into turns and never goes inside rock.
- The bird always glides forward. Left and Right arrows (or A and D) bank and turn it; Up and Down arrows (or W and S) pitch it up and down. It slowly loses height; diving and wind give it back.
- Flying through a ring collects it: the ring flashes and the counter goes up. Each ring counts once.
- Hitting a wall or the ground is a crash: the bird crumples or bursts into paper scraps, the crash count goes up, and after a moment the bird starts again from the last ring it collected, gliding. It never passes through rock.
- A counter on screen shows the rings collected out of the total, as "7 / 14", all the time.
- At the finish line the game shows how many rings I collected out of all of them and offers to fly again.
- When the page opens, the bird is already flying the course by itself (a demo flight that takes every ring) until I press one of the flying keys; then it is mine, from the start.
FOR CHECKING Expose these on window. Positions are in metres, y up.
getState()returns{time, x, y, z, speed, rings, ringsTotal, crashes, finished, demo}:ringscollected so far,ringsTotalalong the course,crashesso far,finishedtrue once past the finish line,demotrue while the demo flight flies.getCourse()returns{rings: [{x, y, z, radius}, ...], finish: {x, y, z}}, the rings in course order.- The game runs on a fixed 60 Hz tick, independent of the display rate.
seek(t): start the demo flight again from the start and run it totseconds, as fast as it can; the page carries on live from there. The sametalways gives the same state.restart(): put me, not the demo, at the start: counters at zero, no keys held.advance(dt): run the game forwarddtseconds now (round(dt × 60) ticks) with the keys as they are held, then carry on live.- Keys are read from
keydownandkeyupevents onwindow, byevent.key.
SELF-REVIEW LOOP (mandatory)
- Screenshot the page at 1920x1080 at seek(5), seek(20) and seek(40) of the demo flight, and mid-interaction: banking hard through a turn, passing through a ring, and a crash. Use your preview tool or a headless browser; a URL hash that seeks on load (such as
index.html#t=12) makes set moments easy to capture. - Look at the screenshots as a harsh art director would: list what reads as cheap, default, unfinished or off-palette, worst first.
- Fix the top 5.
- Repeat. Do at least 3 rounds; stop only when the worst problem left is minor.
- Write
dist/review.mdin English: for each round, the moments you shot, the critique and the five fixes.
BUDGET About 60 to 90 minutes of work. Get a working page early, then spend most of the time on the look and on the review rounds.
DELIVER dist/index.html, dist/three.module.js and dist/review.md.
DONE WHEN The page opens with no console errors, the demo flight takes every ring and crosses the finish, I can fly it myself, crash into a wall and carry on, and dist/review.md records at least three review rounds.
Task brief
- Setting
Small browser games made by models tend to work and look plain. This one has to feel like a frame from an animated film and still play properly: rings that count only when you fly through them, walls you can't fly through, a demo flight that finishes the course. The look is judged from a screenshot mid-flight; the game is measured through the page's own hooks.
- Inputs
- Text
- Materials
three.module.js: three.js r170, to copy unchanged into dist/.
- Deliverable
dist/index.html and dist/three.module.js: the game on a canvas that fills the window, working offline from these two files. dist/review.md: the self-review rounds.
How it’s checked
- The final screenshot looks like a toon-shaded canyon at sunset in the brief's palette: flat banded lighting, warm lit rock against violet shadow, fog in the distance; not default grey three.js materials, a black background or debug helpersJudge model
- A low sun that lights one wall and leaves the other in shadow, a sunset sky gradient, and fog that blends the far canyon into the skyJudge model
- The bird reads as folded paper: faceted and creased, in paper colours, outlined or rim-lit, with wings that flexJudge model
- The code has hand-written post-processing as the brief asks (a bloom on the rings and sun, a warm grade, a vignette), and it shows in the screenshotJudge model
- The game is complete: visible wind that moves the bird, a ring counter on screen, crashes with a visible effect and a restart from the last ring, a finish screen with the ring count and a way to fly againJudge model
- dist/review.md records at least three rounds of screenshots, a harsh critique and five fixes each, and the final page shows those fixesJudge model
- Flight, ring pickups and crashes come from the page's own fixed-tick simulation against the canyon's geometry, and the demo flight steers the same bird; nothing is scripted or faked for the checksRed lineJudge model
- Page file is thereAutomatic
- Review notes are thereAutomatic
- Works offlineAutomatic
- Loads without errorsAutomatic
- Uses the three.js it was givenAutomatic
- Canvas fills the screenAutomatic
- Test hook worksAutomatic
- 12+ rings and a finishAutomatic
- Demo flight finishesAutomatic
- Rings count honestlyAutomatic
- Steers and climbsAutomatic
- Crashes are handledAutomatic
- Ring counter on screenAutomatic
- Same time, same flightAutomatic