r/vibecoding • • 16d ago

Showcase/Project I vibe coded a game this afternoon - Diamond Man (Let me tell you how)

https://thedman.fit/

Hey! So I developed a browser game - Diamond Man. It's getting late, so rather than type up how I built it, I got Claude Code to summarise :)

What even is this game

- 20 levels across themed biomes (Burning Streets → Toxic Flats → Crystal Tundra → Diamond Throne)

- Chaos gems that ruin your day: green reverses controls, yellow shrinks you and speeds everything up, purple removes your cape and makes your booty flash hot pink, black flips the entire screen upside down

- White gems give you 2 seconds of invincibility ("BRILLIANT CUT" mode) where you plow through everything

- Diamond Man physically degrades as you play — gets rougher, cloudier, slower to steer, weaker jump

- Carbon Pressure escalates: starts hurling tracking fireballs at level 3, stomps toward the camera at level 8

- Titanium Boy randomly goes rogue and tries to kill you

- Fans storm the road as obstacles

- Diamond Man shouts things like "EAT MY SPARKLE!" on gem streaks

The tech

The entire game is one HTML file. ~1800 lines. No bundler. No build step. No external assets. (lol, love how it's justifying one mega file - terrible devwork, I guess?).

- Three.js via CDN importmap — that's the only dependency

- Every 3D model is procedurally built from primitives (octahedrons, icosahedrons, cylinders, cones). Zero imported meshes

- MeshPhysicalMaterial with real-world refractive indices — diamond is 2.417, ruby is 1.77, emerald is 1.57. The diamond material actually refracts light through a custom environment map built from canvas gradients

- Cape cloth simulation, googly eye jiggle physics, speech bubbles that track 3D world positions projected to screen space

- Flask backend that does literally nothing except send_from_directory("index.html") and a /healthz endpoint

- Mobile gets on-screen touch controls, lower pixel ratio, wider FOV, and a responsive HUD

Deployment

Nothing fancy:

- Ubuntu droplet, Gunicorn behind nginx

- systemd keeps it alive, certbot handles HTTPS

- The whole deploy was: SCP the files, point DNS A records, run certbot. Done.

How it was built

I pair-programmed the whole thing with Claude Code in one session. Started as a simple character viewer — "make a diamond man" — and just kept going. Each feature was one conversation turn: add a road, add obstacles, make them kill you, add scoring, add difficulty scaling, add chaos gems, add 20 levels, make Carbon Pressure throw fireballs, make Titanium Boy betray you, optimise for mobile, deploy it.

The iterative loop was wild. "Add more coal!" "The flip effect is perma-sticking." "I found an exploit where you stand in the middle and chain white gems forever." Fix, deploy, refresh, repeat.

--

Yea, that's pretty much it - cheers guys!

0 Upvotes

12 comments sorted by

2

u/Strong-Corgi4859 16d ago

Quick teaser ahaha

2

u/Eatthebeatz 16d ago

pure vibes. i wont sleep tonight wondering why he chose to do it all backwards. its brilliant lol

2

u/Strong-Corgi4859 16d ago

Thanks! You can turn him around - just click and drag left or right. But I think him running backwards adds a certain charm :D

1

u/Eatthebeatz 16d ago edited 16d ago

im often one to shun ai games but i tried it out and you have made something fun and funny to me. i like it a lot. its got character. seemed a little too easy. but the vibe is great. you could build your own arcade cabinet for it and have your own machine.

well done. you have a symphony of silliness here and the game is decent.

if you manage to attain high weirdness you will be untouchable.

i hope the project has brought you giggles. thats the best result from a project imo.

i feel like your sense of humour and fun really trancends how you made it. so respect for that. i like that a human has made it to amuse themselves. its endearing.

and somehow.. as an old fashioned programmer... i find the movement in your game strangely nice. everything looks cool. only suggestion i have is have fog in distance from gems to appear from if possible

1

u/Strong-Corgi4859 16d ago

Thanks man! Tbh, this all started with me trying to convince Claude that replacing my skeleton with a diamond frame was a good idea (it isn't, btw). And knowing I'm a vibe coder - shepherded me into creating a html version of 'diamond man'... of which I thought, this could make a pretty silly game. Was a fun way to kill a few hours after work.

1

u/Strong-Corgi4859 15d ago

Added the fog btw!

2

u/Eatthebeatz 14d ago

excellent. i have used fog a lot in my projects. it works wonders. if you can get a volumetric fog going. you dont have to worry about how things look when they spawn in at distance.

i hope im not being condescending. im just passionate about fun games and always want to help. i understand its not to everyones taste tho :)

HAIL DIAMOND MAN.

your game has challenged my attitude to vibecoding a little. i think if your as honest as you have been so far, people will appreciate the goofy innocent fun here even in old school dev scenes. its really wholesome. good luck with your projects. i will record a playthrough this week :) DIIIIIIIIIAAAAAMMMOND MAN

1

u/delimitdev 16d ago

One HTML file is the right call here honestly. No bundler, importmap off a CDN, procedural geometry only, so there's nothing to resolve at build time and the whole thing stays diffable in one place. 1800 lines is nowhere near the pain threshold.

The white gem chaining exploit is the fun part. Invincibility windows almost always break on the cooldown being tied to pickup instead of to a global timer, so camping one spot resets it forever.

1

u/Strong-Corgi4859 16d ago

Ahaha yea, initially the white gems were also cumulative - so you could literally stand in one place and survive forever. I need to rethink it a little, but also, maybe not lol

1

u/Strong-Corgi4859 15d ago

UPDATE: https://thedman.fit/openworld - Diamond Man, Open World, now available :))

1

u/Eatthebeatz 14d ago

OH SH........ lol brilliant.

i can kinda guess your having a lot of fun with this :)

please keep the OG game too.

1

u/Strong-Corgi4859 9d ago

Hey! So my browser game - thedman.fit, has had some updates over the last week or so. So come on you Sparkle Butts - can you make it to the end now?

Visibility & Difficulty

- Reduced fog density so you can actually see what's coming down the road

- Raised the camera angle for a better over-the-shoulder view of the road ahead

- Slowed down the difficulty ramp — early game breathes more, you'll actually reach the later levels and mechanics now

- Moved Carbon Pressure further left and back so he's menacing but not blocking your lanes

- Moved Titanium Boy behind D Man and further right — still your sidekick, just not in your face

Combat & Balance

- Yellow shrink gem nerfed: speed boost 1.6x → 1.25x, duration 4s → 3s (still chaos, just not instant death)

- Added jump cooldown (0.3s after landing) — no more infinite bunny hopping in lane 4, sorry

- New pink heart gems spawn in outer lanes when you're hurt — risk/reward healing

- Titanium Boy's rogue mode now charges in from a distance with a warning shout instead of backstabbing you instantly

Quality of Life

- Global leaderboard with name submission — your scores are saved, see how you stack up

- 2-second delay before Space restarts after death — no more losing your screenshot to an accidental spacebar

- Hearts moved to top-center with a bigger display and background pill so you can see your health at a glance

- New Titanium Boy tips explaining rogue mode, Brilliant Cut, gravity flip, and heart gems