DEV Community

Cover image for I Built a Full 3D Endless Runner Game in the Browser (Itโ€™s in KBs btw)
Ishant Singh
Ishant Singh

Posted on

I Built a Full 3D Endless Runner Game in the Browser (Itโ€™s in KBs btw)

Hey devs, Ishant here ๐Ÿ‘‹

Quick question before we start:

Why does every web game need to be 200MB?
And why does my phone start sounding like a jet engine the moment I open them?

So I did something irresponsible........again!

In ~6 hours, fueled by coffee and poor decisions,
I built Metro Runner โ€” a full 3D endless runner that runs entirely in the browser.

No Unity.
No Unreal.
No Godot.

Just Three.js, React, and audacity. ๐Ÿ’€


๐Ÿ“ฆ Size Flex (Chrome Users Donโ€™t Know This LOL)

Hereโ€™s the funny part.

Metro Runner is a PWA.

Which means:

  • Chrome already ships the engine
  • Three.js is shared
  • Assets are all CSS and magic

๐Ÿ‘‰ Actual download size: a few hundred KBs

Yes.
KBs. Not MBs. Not GBs.

You can literally:

  • open the site
  • install it
  • and boom โ€” game on your home screen ๐Ÿ’ป๐Ÿ“ฑ

Chrome users donโ€™t even realize they already downloaded half the engine when they installed Chrome. (I was one of them ๐Ÿ’€๐Ÿ’€)


๐ŸŽฎ What Even Is Metro Runner?

Itโ€™s a 3D endless runner with:

  • Three-lane movement
  • Jump / slide mechanics
  • Increasing speed
  • Coins
  • Power-ups
  • A shop
  • Multiple biomes
  • And a UFO abduction event (weโ€™ll get there ๐Ÿ’€)

Think Subway Surfers, but:

  • browser-native
  • actually 3D
  • and way more unhinged.

๐Ÿ‘‰ Play it here: https://metrorunner.vercel.app/


๐Ÿง  โ€œDid you use a game engine?โ€

No ๐Ÿ˜

This is:

  • React Three Fiber (Three.js)
  • Custom game loop
  • Manual collision logic
  • Fake speed via world movement
  • Delta-time based motion

The player barely moves forward.
The world rushes toward you.

Classic illusion.
Still undefeated.


๐Ÿš‚ Trains, Ramps, and a Bug That Became a Feature ๐Ÿ’€

Hereโ€™s where it gets funny.

At high speed, sometimes:

  • the player hits a train ramp
  • trips
  • gets launched
  • and dies ๐Ÿ’€

I tried fixing it:

  • Sweep collision
  • Alignment tweaks
  • Debugging at speeds that felt illegal

Did it work?

No.

So I did what every sane developer does:

If you canโ€™t fix a bug โ€” promote it to gameplay.

๐Ÿง  Lore Update:

Some train ramps are slightly misaligned with coaches.

Which means:

  • at high speed
  • sloppy jumps
  • bad timing

๐Ÿ‘‰ You get knocked off and game over.

Now itโ€™s not a bug.
Itโ€™s โ€œskill-based punishment.โ€ ๐Ÿ˜ค


๐Ÿš‚ Train Systems (a.k.a. pain generators)

  • Regular trains (static + moving)
  • Triple Train Ramp sections (~10%)

    • All lanes blocked
    • Ramps on top
    • Huge coin reward
  • Train Hopping sections (~10%)

    • Jump between trains across lanes
    • Miss once = back to menu ๐Ÿ’€

Trains have real collision.
No ghost clipping.


๐Ÿ‘ฝ Alien Abduction Event (I Lost Control Here)

Random event during runs:

  • UFO appears
  • Green lights
  • Tractor beam
  • Screen fades
  • You teleport to a new biome
  • +25 free coins
  • Temporary invincibility

Is it realistic?
No.

Is it funny watching a runner game suddenly turn into sci-fi?
Absolutely. ๐Ÿ›ธ


โšก Power-Ups (Yes, Those Particles Are REAL)

Power-Up Effect
๐Ÿงฒ Magnet Pulls coins
๐Ÿ‘Ÿ Super Boots 2.0ร— jump
๐Ÿ›น Hoverboard One free crash
๐Ÿš€ Headstart Rocket boost
โœ–๏ธ Multiplier Double coins
๐Ÿš€ Jetpack Fly above obstacles

And yes:

  • those particles
  • wind streaks
  • speed lines

Theyโ€™re not โ€œvisual effectsโ€.
Theyโ€™re selling the illusion of speed.

Jetpack particles come from the jetpack, not vibes ๐Ÿคก


๐Ÿช Shop System (I Went Too Far)

  • Buy power-ups with coins
  • Upgrade magnet duration (up to 6 levels)
  • Choose starting power-ups
  • Inventory persists via localStorage

Close the tab.
Reopen later.

Your grind is saved. ๐Ÿ˜ค


๐ŸŒ Biomes

  • ๐Ÿš‡ Subway
  • ๐Ÿ™๏ธ City
  • ๐ŸŒฒ Forest

Biome switches are forced, so runs donโ€™t feel copy-pasted.


๐Ÿฅš Easter Egg

Click the game title in the menu.

Thatโ€™s all Iโ€™ll say ๐Ÿ˜


๐Ÿ”ง Tech Stack (a.k.a. bad decisions)

  • React + TypeScript
  • Three.js (via React Three Fiber)
  • Custom collision logic
  • Particle systems
  • PWA (installable, offline-friendly)
  • Saved state via localStorage

No engine.
No physics library babysitting.
Just math, timing, and vibes.


๐Ÿง  Why I Built This

I wanted to see:

Can a real 3D game live comfortably in the browserโ€ฆ and still feel good?

Turns out โ€” yes.

And it fits in KBs.

Which still feels illegal.


๐Ÿ™Œ Feedback / Roasts Welcome

If you play it:

  • tell me where you died
  • tell me which ramp betrayed you
  • tell me if the UFO jump-scared you

Now excuse me while I pretend this was โ€œjust a quick experiment.โ€

โ€” Ishant ๐Ÿ–ค


Top comments (0)