Three.js game · Portrait mobile

RAIL GRIND RUSH:
A THREE.JS 3D NEON RAIL GRINDING GAME

Rail Grind Rush is a free Three.js 3D rail grinding browser game. Swipe to switch neon rails, tap to jump barriers and gaps, and chain near-miss combos over a night city. WebGL, no download.

· Game overview · Hosted by Indie Forge Studio

Play Rail Grind Rush

⚒ By Indie Forge Studio

Phones: swipe to switch rails, tap to jump · Desktop: arrow keys or A and D, Space to jump · P pause · M mute

What Is Rail Grind Rush?

Rail Grind Rush is a free portrait 3D rail grinding game for phones and desktop. A skateboarder in an orange hoodie grinds three glowing neon rails high above a glowing night city, with sparks spraying off the board. Swipe to switch rails, tap to jump, and keep the grind going.

Barriers sit on the rails and some rails break into gaps. Jump or switch lanes to get past them. Clear an obstacle at the last moment for a near miss, and near misses in a row build a combo that adds bonus points. The rails get faster the longer you survive.

How to Play Rail Grind Rush

  • Swipe: swipe left or right to hop to the next rail.
  • Tap: tap anywhere to jump. The skater pulls a trick in the air.
  • Barriers and gaps: hit a barrier or fall through a gap and the run ends.
  • Near miss: a late jump over a barrier, a landing just past a gap or a last-moment lane switch scores a near miss. Each one in a row raises the combo and adds 50 times the combo in bonus points.
  • Desktop: arrow keys or A and D switch rails, Space jumps. P or Esc pauses, M mutes.

How Rail Grind Rush Is Built with Three.js

Rail Grind Rush is a single self-contained ES module on a self-hosted Three.js build. There are no model files: the skater is built from boxes and spheres, the rails are short glowing box segments that recycle around the player, and the city is a set of boxes with a canvas window texture. A rail gap is just a stretch of segments that get hidden.

Obstacles are generated a row at a time just ahead of the skater. Each row picks which rails are blocked and whether each one gets a barrier or a gap, and the number of blocked rails grows with distance:

Built for Mobile and Portrait Play

Rail Grind Rush is made for one thumb on a phone held upright, and it runs in a centered 9:16 portrait frame on every screen. The HUD keeps the top clear: a big score in the middle, a pink near miss combo pill under it that only appears while you have a combo, and a gem counter at the top right. A short swipe and tap hint sits at the bottom, with round pause and mute buttons in the corner. The pause menu has Resume and Main Menu, and the How to Play panel pauses the game while it is open. Your best score and gem total are saved on your device.

Code from Rail Grind Rush

Each new row of obstacles is placed ahead of the skater. The number of blocked rails and the length of the gaps both grow with distance, and the next row is spaced out by the current speed so there is always time to react:

function genRow() {
  const lv = S.D / 150, d = Math.max(S.nextD, S.D + 30);
  const n = lv < 1 ? 1 : lv < 3 ? (Math.random() < 0.5 ? 1 : 2) : (Math.random() < 0.15 ? 3 : 2);
  const lanes = [0, 1, 2].sort(() => Math.random() - 0.5).slice(0, n);
  const gapLen = lv > 4 && Math.random() < 0.4 ? 9 : 6;
  let maxEnd = d;
  const dd = Math.round(d / SEGL) * SEGL;
  for (const L of lanes) {
    if (Math.random() < (lv < 0.6 ? 0.2 : 0.38)) { S.gaps.push({ lane: L, a: dd, b: dd + gapLen, passed: false, nm: false }); maxEnd = Math.max(maxEnd, dd + gapLen); if (Math.random() < 0.7) addCoin(L, dd + gapLen / 2, 1.5); }
    else { S.rows.push({ lane: L, d, passed: false, nm: false }); }
  }
  const free = [0, 1, 2].filter((l) => !lanes.includes(l));
  if (free.length && Math.random() < 0.8) { const L = free[Math.floor(Math.random() * free.length)]; for (let i = 0; i < 5; i++) addCoin(L, d - 6 - i * 2.2, 0.95); }
  S.nextD = Math.max(d + Math.min(34, Math.max(19, S.v * 1.4)), maxEnd + 9);
}

From games/rail-grind-rush/game.js

A near miss does three things at once: it raises the combo, adds bonus points equal to 50 times the combo, and restarts the four second combo timer:

function nearMiss(label) {
  if (S.mode !== 'play') return;
  S.combo++; S.near++; S.topCombo = Math.max(S.topCombo, S.combo); S.comboT = 4;
  S.bonus += 50 * S.combo;
  showBanner(label, 0.9, 'COMBO x' + S.combo);
  const lx = LANE_X[S.lane]; floatText('+' + 50 * S.combo, lx, 1.8, -S.D, '#ffd24a');
  burst(lx, 0.8, -S.D, 0x3ff0ff, 10, 1); beep(660 + S.combo * 60, 0.1, 'triangle', 0.06, 200);
}

From games/rail-grind-rush/game.js

The per-frame step moves the skater, runs the jump physics and then checks the three things that can end a run or add points: a gap under the skater, a barrier at the skater's height, and coins:

function step(dt) {
  S.t += dt;
  if (S.dead) {
    S.deadT += dt;
    if (S.dead === 'fall') { S.deadVy -= 30 * dt; hero.position.y += S.deadVy * dt; hero.rotation.x -= dt * 3; hero.rotation.z += dt * 2; }
    else { S.deadVy -= 24 * dt; hero.position.y = Math.max(0, hero.position.y + S.deadVy * dt); hero.position.z -= S.v * dt * Math.max(0, 0.6 - S.deadT); hero.rotation.x -= dt * 7; hero.rotation.z += dt * 3; board.rotation.y += dt * 9; }
    if (S.deadT > 1.0) { if (S.mode === 'play') gameOver(); else if (S.mode === 'start' && S.deadT > 1.6) attract(); }
    return;
  }
  S.v = 13 + Math.min(15, S.D * 0.0125);
  S.D += S.v * dt;
  S.lx += (LANE_X[S.lane] - S.lx) * Math.min(1, dt * 14);
  // jump physics
  if (S.h > 0 || S.vy > 0) { S.vy -= GRAV * dt; S.h += S.vy * dt; if (S.h <= 0) { S.h = 0; S.vy = 0; landed(); } }
  const grounded = S.h < 0.05;
  // gaps: no rail under you
  if (grounded) for (const g of S.gaps) if (g.lane === S.lane && S.D > g.a + 0.4 && S.D < g.b - 0.1) { die('fall'); return; }
  // barriers
  for (const r of S.rows) {
    if (r.lane !== S.lane) { if (!r.passed && S.D > r.d + 0.5) r.passed = true; continue; }
    if (!r.passed && Math.abs(S.D - r.d) < 0.5 && S.h < BAR_H - 0.05) { die('crash'); return; }
    if (!r.passed && S.D > r.d + 0.5) { r.passed = true; if (!r.nm && S.h < 1.5) { r.nm = true; nearMiss('NEAR MISS!'); } }
  }
  // coins
  for (const c of S.coins) if (!c.got && c.lane === S.lane && Math.abs(c.d - S.D) < 0.9 && Math.abs(c.y - S.h - 0.7) < 1.1) {
    c.got = true; S.gems++; S.coinsRun++; S.bonus += 5; beep(900 + (S.coinsRun % 6) * 80, 0.07, 'square', 0.04); burst(LANE_X[c.lane], c.y, -c.d, 0xffc040, 5, 0.6);
    if (S.mode === 'play') try { localStorage.setItem(GEM_KEY, String(S.gems)); } catch (e) {}
  }
  if (S.comboT > 0) { S.comboT -= dt; if (S.comboT <= 0) S.combo = 0; }
  S.score = Math.floor(S.D * 1.5) + S.bonus;
  while (S.nextD < S.D + 95) genRow();
  cleanup();
  // grind sparks + sound
  if (grounded) { S.grindT -= dt; if (S.grindT <= 0) { S.grindT = 0.06; burst(S.lx, 0.2, -S.D + 0.5, 0xffa020, 2, 0.5); if (S.mode === 'play') noise(0.05, 0.03, 2500); } }
}

From games/rail-grind-rush/game.js

The glowing city windows come from one small canvas texture. A seeded random number generator lights random cells in pink, cyan, orange and yellow, so each building looks different without any image files:

function winTex(seed) {
  const c = document.createElement('canvas'); c.width = 64; c.height = 128; const g = c.getContext('2d');
  g.fillStyle = '#0a0a1c'; g.fillRect(0, 0, 64, 128);
  const cols = ['#ff3fd0', '#3ff0ff', '#ffa030', '#ffe070', '#7a5cff'];
  let s = seed * 9301 + 49297;
  const rnd = () => { s = (s * 9301 + 49297) % 233280; return s / 233280; };
  for (let y = 4; y < 124; y += 8) for (let x = 4; x < 60; x += 8) { if (rnd() < 0.38) { g.fillStyle = cols[Math.floor(rnd() * cols.length)]; g.globalAlpha = 0.5 + rnd() * 0.5; g.fillRect(x, y, 5, 5); } }
  g.globalAlpha = 1;
  const t = new THREE.CanvasTexture(c); t.colorSpace = THREE.SRGBColorSpace; t.wrapS = t.wrapT = THREE.RepeatWrapping; return t;
}

From games/rail-grind-rush/game.js

Play Rail Grind Rush

Free, in your browser, no download. Hosted by Indie Forge Studio.

More games: Browse all 3D games

Frequently Asked Questions

How do I play Rail Grind Rush?

Open https://indieforgestudio.com/games/rail-grind-rush/ and press Tap to Play. Swipe left or right to switch between the three neon rails and tap to jump barriers and gaps. On desktop, use the arrow keys or A and D to switch rails and Space to jump.

Is Rail Grind Rush free and does it need a download?

Yes. Rail Grind Rush is free and runs instantly in your web browser on phones, tablets and desktop. There is nothing to download or install.

What technology is Rail Grind Rush built with?

Rail Grind Rush is a 3D browser game built with Three.js on WebGL by Indie Forge Studio, using plain JavaScript and HTML5 with no plugins. The skater, rails, barriers, coins, drones and city skyline are all built from Three.js shapes and canvas textures, with no model files.

Does Rail Grind Rush work on mobile?

Yes. Rail Grind Rush is designed portrait-first for phones with swipe and tap controls, and it also plays in a centered portrait frame on desktop with the keyboard.

How do I score a near miss in Rail Grind Rush?

Clear a barrier with a late jump, land just past the end of a rail gap, or swipe to another rail right before an obstacle. Each near miss in a row raises your combo and adds bonus points equal to 50 times the combo. The combo fades after about four seconds without one.