This is an independent reimplementation of Cubefield, the
Flash game written by Max Abernethy of flecko.net in
2006. It is not affiliated with, endorsed by, or connected to him, and no
code or artwork from the original SWF ships here.
The simulation is a line-by-line reconstruction of the original's ActionScript, recovered by
decompiling the 2006 SWF, so the numbers below are the game's own, not estimates.
What is the same
The 24 fps fixed step and every per-frame constant that hangs off it.
Steering: left and right add or subtract SpeedTarget/13 to a lateral velocity
that is multiplied by 0.88 every frame. The ship never moves — the field does.
The two-axis projection, half-angles 0.3 and 0.22 radians, cube
size 70, spawn plane 4000, despawn plane -200.
The kill box: a cube ends the run when its centre is inside 120 < Z < 280
and |X| < 48. Not the nose, not a radius — a box. Plus 25 frames of grace at the start.
The sixteen-pattern playlist: the funnel, the corridor, the diamonds, the sine curves, the
gaps and the three random blocks — with their real row counts and spacings.
The ramp: +15 speed per round, density +0.1 to a ceiling of
0.7, corridor width down to 4, then +25 per round forever.
The four palettes, in order, one step per round: orange, green wireframe on black, black on
white, pink with white edges — and the score text turning white for the green phase.
Score is the accumulated target speed, one tick per frame, exactly as the original
counted it; the top score is banked at the instant of the crash.
Four faces per cube (left, right, near, top — no bottom, no far face), painted back to
front with no depth buffer, fading in as they arrive.
The ship's three grey facets and its slide up from below the stage; the roll; the blur and
fade on death; P to pause and Q for quality; the attract-mode field
that never puts a cube within two lanes of centre.
What is different
It is drawn with WebGL instead of Flash's vector API. The perspective happens on the GPU,
from world-space cube corners, using the original's own formula.
Randomness comes from a seeded generator, so a run is reproducible from a number. The
original called the host's Math.random().
The original stretched its 400×300 stage to whatever size the page gave it. The
default here keeps the aspect ratio; Stretch in Options restores the old behaviour.
The clouds in the fourth palette are drawn shapes, not the original's bitmaps.
Fonts are whatever your system has; the original embedded Bookman Old Style.
The sponsor logo, the splash screen and the 2006 “play more games” link are gone.
Q changes the render resolution rather than Flash's _quality setting.
Three additions, all off by default and listed in Options: a daily seed, a ghost of your
best run on the current seed, and a replay you can copy out and paste back in.
Controls
←→ or AD steer ·
P pause · Q quality · Enter or
Space start a run · Esc close a panel.
On a touch screen, hold the left or right half of the field; opening About or Options
pauses a run, and a tap on the field resumes it.
Options
The three extras below are not in the 2006 game. Leave them off
for the original experience.
Presentation
Seed: -
Replay of your last run — paste one back to watch it.