My recent quest…
Momoyo Run: three worlds, ninety seconds, and a finish line
A runner for Momoyo, the ice cream and fruit-tea shop. Tap to jump, tap again to somersault, three worlds that change every thirty seconds, and a ribbon across the door at ninety. Every gap and every coin was checked against the jump physics before it shipped.
Momoyo Run is a runner I built for Momoyo, an ice cream and fruit-tea shop. It is the second game I have made, and the first one where I did not leave the ending open: a run finishes at ninety seconds, in front of the shop, with a ribbon across the door.
It runs in a browser, sideways, on a phone or a tablet. There is one control. Tap to jump, tap again in the air for a somersault, and the mascot keeps running until something hits it. On an iPhone it is added to the home screen first, because a plain web page cannot go fullscreen there.
A run is three worlds, thirty seconds each. It opens on the shop: red paving, awnings, the mascot in a bear hood. Then the fruit garden, then a land of ice cream on waffle cones. Speed goes 385, 470, 555. Every thirty seconds the old world fades out and the next one slides in from the right, behind a signboard and a short fanfare.
Each world has its own seven obstacles. Four are low enough for a single jump: a cone, a cup, a crate, a block of ice; then watermelons, pineapples, a scarecrow; then a macaron, a pudding, a scoop. Three are 140 units tall against a jump that peaks at 114, so those need the somersault. Anything you hit ends the run, and the mascot goes down forwards: a stumble, a fall, a slide, and dizzy stars.
Coins are worth 10, and the big starred ones are worth 50. Score is metres plus the coins, and the distance locks the moment you are hit, so the number on the receipt is the number you had when you lost.
At ninety seconds there is a finish gate and the flagship store. The mascot breaks the ribbon, the world slows to a stop, confetti fires from both corners, and the receipt prints with a green SAMPAI stamp.
Difficulty is not tuned by feel. The gap between obstacles comes out of the jump itself: one jump peaks at about 114 units and hangs for about 0.56 seconds, so the tightest safe gap is whatever still leaves room to land and jump again. That gap tightens from 1.35 to a floor of 1.08 times the airtime across two and a half minutes — though a finished run only ever reaches ninety seconds of that curve.
The spacing is not uniform either. It rolls three rhythms: a normal gap, a tight burst of one to three gaps at about 0.8 times the airtime, and a breathing gap at two to 2.6 times. In a burst the first jump has to go early and the next one goes the moment the mascot lands, and there is still about 0.29 seconds of slack. Bursts are kept away from tall obstacles, from the moment the speed changes, and from the three and a half seconds before it.
Then the coins. A big coin sitting in a tempting place is a trap, and every trap is proved before it is used: the same physics as the game, searched over every possible sequence of taps, has to show that the coin cannot be collected without dying. That search runs in a Web Worker so it never stalls a frame. If a trap cannot be proved, it does not go in.
The whole thing is checked by a bot on localhost that jumps in the middle of the window. It survives three minutes through about 120 tight bursts.
Rewards will be handed out against the score, so the score cannot be something a player types into a box. A few things follow from that.
- The score is drawn inside the canvas, not written into the page. There is nothing to select in inspect element.
- Distance, coins, and score live only inside the game function.
window.MomoyoGameexposes two frozen functions, and the test hooks exist on localhost only. - Settings are frozen and come from the server or the build. The copy in localStorage is read on localhost only.
- The developer panel opens when the logo is tapped five times, but only for an account the server recognises as superadmin. That session cookie is HttpOnly, so it cannot be faked from the console.
- The best score saved on the device is signed. A number typed into localStorage is ignored.
The honest limit is the one that cannot be designed away: all of it runs on the player's phone. Someone who sets breakpoints in DevTools and replaces the JavaScript files can still make the screen say anything. What is closed is the easy route — the console, inspect element, and localStorage.
That is also why the reward is claimed by showing the receipt at the counter, with no code and no record on the server. It keeps the game simple. It does not make it tamper-proof, and I would rather write that down than imply otherwise.
The mascot, the obstacles, and the three backgrounds all come from images I generated with Gemini, then cut into sprites by small Python scripts. The folder holds 67 images: three run styles at eight frames each, a somersault, jump, fall, land, the face-down pose, three backgrounds in two layers, and 21 obstacles. Each job has its own script.
The running style follows the speed as well: a normal run at 385, a lean at 470, a full sprint at 555, each with its own face, down to the sweat. Getting the mascot's proportions to stay put across all of it was the part that took the most passes.
Sound and music are synthesised with Web Audio rather than loaded as tracks — pulse, triangle, and 1-bit noise channels. The whole sprite set is about 1 MB, which is what lets it open quickly on a phone.
The obvious next thing is a global leaderboard, and it is the one I am deliberately not building yet. Every score is a number the phone reports about itself, so a global board would rank whoever edits the file with the most confidence. That is worse than no board.
The best score stays on the device until a run can be checked on the server, most likely by replaying the tap log against the same physics. That is real work, and it is the honest condition for putting other people's scores next to each other.
The other thing I want is a fourth world. Three is what fits in ninety seconds at this ramp; a fourth means either a longer run or a faster climb, and I have not decided which one is better.
Comments
Comments cost $0.10 in USDC on Base or Solana. The payment is checked on-chain before the comment appears, which keeps spam out.
More threads will appear here as things happen. Tell me what you're working on.
Loading comments…