Three.js game · Portrait mobile
DRIFT DASH:
A THREE.JS 3D DRIFT RACING GAME
Drift Dash is a free Three.js 3D browser racing game. Hold to drift a yellow sports car through the bends of a smooth, winding road over grassy cliff islands in a turquoise sea, grab coins and build your drift bonus. WebGL, no download.
· Game overview · Hosted by Indie Forge Studio
Phones: press and hold to drift into the bend, let go to drive straight · Desktop: hold the mouse, Space, W or the arrow keys · P pause · M mute
What Is Drift Dash?
Drift Dash is a free portrait 3D drift racing game for phones and desktop. A little yellow sports car races along a smooth, endlessly winding road that snakes over grassy cliff islands with palm trees, in a faceted turquoise sea dotted with rocks. Red and white curbs mark every bend. The car drives straight on its own, and your only job is deciding when, and for how long, to drift.
Press and hold to throw the car sideways into the bend in a cloud of tyre smoke, then let go to grip and drive straight. Clean bends grow a multiplier up to x10, long drifts fill a rainbow drift meter for a bonus of up to x3.5, and gold coins trace the racing line. Hold too long or let go too early and you slide off the cliff into the sea. The car speeds up with every bend. Drift Dash is a Three.js game that runs as a 3D browser game on WebGL, developed by Shane Brumback and hosted by Indie Forge Studio, where you can play it at indieforgestudio.com/games/drift-dash/. It is free with no download.
How to Play Drift Dash
- Drift: press and hold anywhere as the road starts to turn. The car always drifts toward the road ahead, so you never pick left or right.
- Drive straight: let go and the car grips and keeps going the way its nose points. Short taps fix small mistakes, and long bends need a held drift or a few feathered taps.
- Bends: each bend you clear scores 10 points times your multiplier. Come out near the middle for a PERFECT (+1 multiplier, up to x10), a little wider for a GOOD, and near the curb for a CLOSE CALL that resets it.
- Drift bonus: the purple DRIFT badge climbs from x1.0 to x3.5 while you hold, shown on the rainbow meter, and pays out when you let go.
- Coins and distance: you score 1 point per metre. Coins are worth 5 times your multiplier, and the big apex coin in each bend counts double. P pauses and M mutes.
How Drift Dash Is Built with Three.js
Drift Dash is a single self-contained ES module on a self-hosted Three.js build. Everything is made from Three.js primitives and flat-shaded Lambert materials, so it loads fast on phones with no model files.
- The road is a spline centreline sampled every 0.25 metres. It alternates short straights with bends whose curvature follows a sin² curve, so every bend eases in and out with no kinks. Each bend is always wider than the car's 4 metre drift circle, and the road heading is kept within about 45 degrees of straight ahead so it winds up the screen.
- Every 30 metres of samples become one chunk of vertex-coloured triangles: asphalt, curbs that turn red and white wherever the road bends, grass verges of varying width, a grass lip and grey cliff walls that drop into the sea. Palms, round trees, bushes and stones are scattered on the verges, and chunks behind the car are removed.
- The car finds the nearest road sample each frame to get its distance along the road and its sideways offset. More than about 2.5 metres from the centre and it flies off into the water.
- Pressing chooses the drift direction by aiming at a point on the road ahead (pure pursuit) and locks it until you let go. While held, the heading turns at speed divided by a fixed radius, so the drift arc stays the same size as the car speeds up.
- The sea is one faceted plane with random per-triangle turquoise shades that follows the camera in 4 unit steps so the facets never swim. A larger plane and fog carry it to the horizon under low-poly clouds, and the chase camera turns gently with the road so the next bends stay on screen.
Built for Mobile and Portrait Play
Drift Dash is designed for one thumb on a phone held upright. It runs in a centered 9:16 portrait frame on every screen. The HUD keeps a white distance card with your multiplier and points at the top left, a coin counter at the top right with the DRIFT badge under it, and the rainbow drift meter at the bottom right. Pointer events give touch and mouse one hold-to-drift code path. How to Play opens a scrollable help panel that pauses rendering, and the pause menu offers Resume or Main Menu.
To stay smooth on phones the renderer caps the device pixel ratio, coins, smoke, skid marks and sparks come from fixed pools, old road chunks are disposed as you pass them, and the game pauses itself when you switch tabs or apps.
Code from Drift Dash
The road is built one 0.25 metre sample at a time. Inside a bend the curvature rises and falls along a sin² curve, and coins are placed on the racing line, hugging the inside of the bend at the apex:
function genSample() {
if (!G.piece || G.pu >= G.piece.len - 1e-6) nextPiece();
const p = G.piece;
G.k = p.curve ? p.kmax * Math.sin(Math.PI * Math.min(1, (G.pu + DS * 0.5) / p.len)) ** 2 : 0;
G.h += G.k * DS; G.x += Math.sin(G.h) * DS; G.z -= Math.cos(G.h) * DS; G.pu += DS;
pushSample();
if (G.coinsOn && G.pu >= G.nextCoin && G.pu <= p.len * (p.curve ? 0.88 : 0.85)) {
// racing line: hug the inside of the bend at the apex (k / kmax), centre on straights
const off = p.curve ? (G.k / Math.abs(p.kmax)) * 1.1 : 0;
const apex = p.curve && Math.abs(G.pu - p.len / 2) < 1.05;
placeCoin(rx.length * DS, G.x + Math.cos(G.h) * off, G.z + Math.sin(G.h) * off, apex);
G.nextCoin += p.curve ? 2.1 : 1.8;
}
}
From games/drift-dash/game.js
Steering is one rule. Holding turns the heading toward the bend at a fixed radius and builds the drift bonus, and letting go grips and drives straight:
// steering: hold = drift (turn at radius RD toward the bend); release = grip and drive straight
if (S.hold) { S.a += S.turnSign * (S.v / RD) * dt; S.holdT += dt; S.driftMul = 1 + Math.min(2.5, S.holdT * 1.2); }
S.drift += ((S.hold ? S.turnSign * 0.45 : 0) - S.drift) * Math.min(1, dt * 8);
S.x += Math.sin(S.a) * S.v * dt; S.z -= Math.cos(S.a) * S.v * dt;
From games/drift-dash/game.js
When you let go after a real drift, the bonus is paid out from how long you held and how high the DRIFT multiplier climbed:
function holdOff() {
if (!S.hold) return;
S.hold = false;
if (S.mode === 'play' && S.holdT >= 0.3) {
const pts = Math.round(S.holdT * 10 * S.driftMul); S.score += pts;
floatText('DRIFT +' + pts, S.x, S.z, '#c4b5fd');
}
S.holdT = 0; S.driftMul = 1;
}
From games/drift-dash/game.js
Play Drift Dash
Free, in your browser, no download. Hosted by Indie Forge Studio.
More games: Browse all 3D games
Frequently Asked Questions
How do I play Drift Dash?
Press Tap to Play. The car drives along a smooth, winding road over grassy cliff islands. Press and hold anywhere to drift into the bend, then let go to grip and drive straight. On desktop hold the mouse button, Space, W or the arrow keys. P pauses and M mutes.
Is Drift Dash free and does it need a download?
Yes. Drift Dash is a free Three.js WebGL 3D browser game. It runs instantly on phones and desktop with nothing to download or install.
How does the multiplier work?
A PERFECT bend, where the car comes out of the bend close to the middle of the road, raises the multiplier by one up to x10. A GOOD bend keeps it and a CLOSE CALL near the curb resets it to x1. Bend points and coins are multiplied by it.
What is the drift bonus?
While you hold a drift, the purple DRIFT badge and the rainbow meter climb from x1.0 to x3.5. When you let go, the drift pays out points based on how long you held and how high the badge climbed.
How is the score counted?
You score 1 point per metre driven. Each bend you clear is worth 10 points times your multiplier, coins are worth 5 points times your multiplier, the big apex coin in each bend counts double, and drift bonuses are added when you let go. Your best score is saved in your browser.
Why did my car fly off the edge?
The run ends when the car leaves the road and drops into the sea. Holding the drift too long slides the car off the inside of a bend, and letting go too early runs it wide off the outside. The car also gets faster after every bend.
Is Drift Dash built with Three.js?
Yes. Drift Dash is a Three.js 3D browser game rendered with WebGL. It uses a procedurally generated spline road built from vertex-coloured chunks, low-poly flat-shaded scenery, a faceted sea, pooled coins, smoke and skid marks, and a chase camera framed for portrait phones.
Where can I play Drift Dash?
Drift Dash is developed by Shane Brumback and hosted by Indie Forge Studio. Play it free at indieforgestudio.com/games/drift-dash/.