How I Built a 3D Endless Runner Game in a Weekend Using AI as My Engineering Partner
Source: Dev.to
The Idea: A Product Vision First
- Three‑lane movement (left / center / right)
- Jump + slide mechanics
- Progressive difficulty curve
- Global leaderboard to drive competition
- Mobile‑first controls (thumb‑friendly)
I didn’t have deep game‑engineering experience — that’s where AI came in.
The Build: Treating AI Like a Junior Engineer
Clear Requirements Beat Clever Prompts
Sprint‑Based Iteration (Not One Big Build)
| Sprint | Focus |
|---|---|
| Sprint 1 | Core movement, camera, obstacle spawning |
| Sprint 2 | Lagos theming (danfos, stalls, environment) |
| Sprint 3 | Scoring + collectibles |
| Sprint 4 | Leaderboard + persistence |
| Sprint 5 | UX fixes from real player feedback |
User feedback → product insight → code changes. This is where PM thinking mattered most.
Feedback
- “The wire obstacle looks like I can jump over it.”
Not a bug — a UX mismatch. The fix was visual affordance, not logic.
Tech Stack (Simple by Design)
- Frontend: Vanilla JavaScript + Three.js (WebGL)
- Backend: Node.js HTTP server
- Database: PostgreSQL (leaderboard persistence)
- Hosting: Replit (dev + prod)
No React. No bundlers. No over‑engineering. Simplicity shipped faster.
What AI Changed for Me as a PM
AI Isn’t Magic — It’s a Teammate
AI responded to:
- Clear requirements
- Defined success criteria
- Structured feedback
Sound familiar? That’s product work.
Domain Knowledge Still Matters
- What makes difficulty feel fair
- Why mobile controls need repositioning
- How obstacles should visually communicate risk
AI executes. PMs decide.
Speed Is the Real Breakthrough
What would have taken months of learning was done in one weekend. Not because AI replaces engineers, but because I could focus on what to build while AI handled how to build it.
The Results (So Far)
- Build time: ~20 hours
- Codebase: ~2,000 lines
- Leaderboard players: 50+ in week one
- Iterations: 5 major versions driven by feedback
- Outcome: a shipped product
Try It Yourself
🎮 Play the game: your link here
If you’re a PM with ideas stuck in your head — this is your sign. The gap between product vision and working software has never been smaller.
Appendix: Technical Deep Dive for Engineers
3D Rendering Architecture (Three.js)
The game uses a fixed player with the world moving toward the camera to create the endless‑runner illusion.
// Object pooling for obstacles
function updateObstacles(delta) {
if (obstacle.position.z > 10) {
obstacle.position.z = -SPAWN_DISTANCE;
obstacle.position.x = lanes[Math.floor(Math.random() * 3)];
}
}
This keeps physics simple and avoids unnecessary transforms.
Collision Detection (Performance‑First)
Bounding boxes instead of mesh collisions:
function getPlayerBoundingBox() {
if (isSliding) {
return slidingBox; // dynamically shrinks the hitbox
}
return standingBox;
}
Simple and performant.
Speed Progression Curve (Bug → Insight → Fix)
// New (consistent) linear scaling with a cap
const speed = Math.min(BASE_SPEED + level * SPEED_INCREMENT, MAX_SPEED);
Predictable challenge.
Mobile Touch Controls (UX‑Driven)
button {
position: fixed;
/* thumb‑reachable, no accidental scrolls, no delay */
}
button.addEventListener('touchstart', e => {
// handle jump or slide
});
Leaderboard Persistence (Postgres)
IF NOT EXISTS (SELECT 1 FROM leaderboard WHERE user_id = $1)
INSERT INTO leaderboard (user_id, score) VALUES ($1, $2);
ELSE IF $2 > (SELECT score FROM leaderboard WHERE user_id = $1)
UPDATE leaderboard SET score = $2 WHERE user_id = $1;
Only personal bests update — no leaderboard spam.
Weekly Reset (Competitive Seasons)
TRUNCATE leaderboard;
Performance Optimizations
- Geometry instancing for repeated assets
- Frustum culling (Three.js default)
- Texture atlasing
requestAnimationFrame‑driven loop
function animate() {
if (!isPaused) {
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
}
File Structure
No build step. No bundler. Just working code.
Final Thought
AI didn’t replace engineering. It collapsed the distance between idea and execution — especially for people who already know how to think in systems, trade‑offs, and outcomes. If you’re a PM, designer, or builder who’s been waiting to “one day build” — that day is now.