Drop from floor to floor — miss and you fall, land on the 锯齿 and you bleed
← Back to Fun TimeThis game is split into small library files inside funtime/lib/, and every function has a comment saying exactly what goes in, what comes out, and the algorithm in plain English. Empty any function out, read its comment, and write it yourself.
| File | What it does | Good functions to try re-writing |
|---|---|---|
| lib/floors-rules.js | The rules: the camera, the landings, the six kinds | screenY, cameraSpeed, landsOn, landOnPlatform |
| lib/floors-draw.js | Painting the shaft, the 锯齿 and the blood bar | drawSawteeth, drawPlatform, renderGame |
| lib/floors-main.js | The glue: the held keys, the touch halves, the loop | doAction, connectBoard, gameLoop |
💡 The big idea: the world stays still and the camera moves. It is tempting to slide all the platforms upwards instead — until you notice that anybody standing on one has to be dragged along too, so hurrying the view would physically fling the player into the ceiling. Move the camera and nothing in the world is disturbed at all.
🛠️ Want to be walked through it? Build Hundred Floors Yourself takes you through the key functions one step at a time and tests each one you write. There is a Python version too.