
Freeride
Behind the Code · Pixel Art, Lighting & C++Our C++17 and WebAssembly snowboarding tribute to Windows 3.1 SkiFree: endless chairlift laps, five-style night floodlights, and Timber Lodge pixel UI.
If you grew up around a Windows 3.1 PC, you probably remember SkiFree: cruising down a bright white screen, dodging pines, and thinking you were safe right until the Yeti charged in from the edge of the monitor. Freeride turns that classic loop into a continuous mountain session where runs flow into a 360-person base lift line, a scenic chairlift ride back up the hill, and carry-over high-score laps.
Everything on screen shares a crisp 3-pixel grid without relying on external art editors. A Python software rasterizer builds all 16-angle riders, skiers, trees, lift houses, and treeline snow-gun masts from blocky 3D shapes, the red-eyed Yeti is typed out directly as 24x24 ASCII pixel rows, and the snow-capped Timber Lodge UI is baked in C++ code at startup. Explore the live sprite sheets, night lighting presets, chairlift loop, and UI boards below.
Timber Lodge Pixel-Art UI

Snow-capped plank signboard on a 427x240 3x pixel grid, paired with the live rotating 16-angle x 5-pose YOUR RIDER outfit card.
427x240 Grid (3x Pixel Scale)Night Riding & Five Switchable Lighting Styles

High-visibility alpine moonlight across the mountain paired with compact, warm golden pools under each pylon crossarm and treeline lamp arm.
Preset Color Channels
Centre Lift Pylon (Dual Crossarm Lamps)
Treeline Mast + Fan Snow GunThe Chairlift & Endless Resort Loop

Runs flow straight into a lively 360-person base corral pre-baked into one GPU texture sheet. You brake at the end of the band and shove through the crowd to the singles gate while the front pair steps aside.
Wheel Houses & Cable Props
Base Terminal (216x252)
Summit Terminal (216x252)
Uphill Chair
128x64 KickerInteractive 3-Layer Rider & 24x24 Yeti Inspector
How One Sprite Sheet Covers Every Outfit
Drawing a separate sprite sheet for every outfit color would mean hundreds of PNGs. Instead, the jacket and pants are saved as plain grey shading. When the game draws a rider, it multiplies those two grey layers by whatever colors you picked, so every player and AI rider gets their own gear from the same three tiny images.
What We Learned Building It
Excerpts straight from the Python art scripts and C++17 game loopChunky 3x3 World Sprites and a 24x24 ASCII Yeti
Riders, skiers, trees, snowmen, kickers, wheel houses, and floodlight masts are posed as tiny blocky 3D meshes in Python and rasterized at one-third scale into chunky 3x3 pixel blocks, with soft blue-grey rims on snow surfaces instead of dark outlines. The revamped Yeti breaks that rule on purpose: he is typed out as ASCII letter rows on a 24x24 grid (sunken shoulders, red eyes, fangs, and claws) across 376 frames.
PIXEL = 3 # every drawn pixel is shown as a 3x3 block
def shoot(mesh, width, height, anchor, px_per_m=PX_PER_M):
w, h = -(-width // PIXEL), -(-height // PIXEL)
mat, tone = sg.rasterize(mesh, w, h, (anchor[0] / PIXEL, anchor[1] / PIXEL),
px_per_m / PIXEL, SS, fill=FILL)
return chunky(sg.to_rgba(mat, soft_edges(mat, tone)), width, height)
T_BODY = {
"front": ["..W..WWWW..W..",
".WWWWWWWWWWWW.",
"WWWWDDDDDDWWWW",
"WWWDRRDDRRDWWW", # D = dark face, R = glowing red eyes
"WWWWDDDDDDWWWW",
"WWWWWDTTDWWWWW"], # T = fangs
}Tinting Grey Layers Instead of Exporting Outfits
Each human rider is three stacked PNGs: a color base layer for helmet, goggles, skin, and boots, plus two greyscale shading masks for the jacket and pants. At runtime, the C++ renderer snaps destination coordinates to whole pixels and multiplies those grey layers by HSV colors. For the 360-rider base lift corral, LiftStation::BakeCrowdSprites pre-tints every outfit into one GPU sheet at startup.
void Player::DrawSprite(Vector2 centre, float size, Direction dir, RiderPose pose,
float lift, Color tint) const {
const Rectangle src = { (float)dir * RIDER_CELL, (float)pose * RIDER_CELL,
RIDER_CELL, RIDER_CELL };
// Snapped to whole pixels so all three layers sample the same texels.
const Rectangle dest = { floorf(centre.x + 0.5f),
floorf(centre.y - lift + 0.5f), size, size };
const Vector2 origin = { size * 0.5f, size * 0.5f };
DrawTexturePro(textures[0], src, dest, origin, 0.0f, tint);
if (textures[1].id != 0)
DrawTexturePro(textures[1], src, dest, origin, 0.0f, mul(jacketColor, tint));
if (textures[2].id != 0)
DrawTexturePro(textures[2], src, dest, origin, 0.0f, mul(pantsColor, tint));
}Baking the Timber Lodge UI on the Same 3-Pixel Grid
Instead of stretching a 9-slice sprite sheet, src/PixelUi.cpp draws every menu, HUD board, and scoreboard directly on a 427x240 virtual grid (3 screen pixels per UI pixel). Snow-capped wooden planks, icicle drips, brass corner nails, proportional 5x7 and 3x5 bitmap fonts, key caps, and the wooden speedometer dial are baked once into tiny GPU textures.
const GlyphDef kBody[] = {
{ 'A', ".###. #...# #...# ##### #...# #...# #...#" },
{ 'B', "####. #...# #...# ####. #...# #...# ####." },
};
Texture2D BakePanel(int w, int h, bool alert) {
const int oy = kSnowRise;
Image im = GenImageColor(w, h + oy, BLANK);
const Color* planks = alert ? kRedPlank : kPlank;
for (int j = 0, yy = 1; yy < h - 1; j++, yy += 6) {
const Color c = planks[j % 2];
ImgRect(im, 1, oy + yy, w - 2, (h - 1 - yy < 6) ? h - 1 - yy : 6, c);
ImgRect(im, 1, oy + yy, w - 2, 1, Shade(c, 18));
}
for (int i = 0; i < w - 2; i++) { // lumpy snow cap along the top edge
const int hgt = 3 + (((i * 7 + (i / 5) * 3) % 5) == 0) + (((i * 13) % 11) == 0);
for (int j = 0; j < hgt; j++) ImageDrawPixel(&im, 1 + i, oy - 1 + j, kSnow);
}Shader-Free Night Mode With Five Switchable Looks
To guarantee identical rendering in desktop OpenGL and browser WebGL/GLES2 without custom shaders, night riding builds a half-resolution 640x360 lightmap with an even piste wash band and smooth rlgl ring-mesh floodlight pools, multiplies it over the world, and then composites volumetric light shafts, anamorphic lamp glare bars, and airborne snow on top.
BeginTextureMode(lightmap); // half-res 640x360 bilinear target
ClearBackground(Color{ dim(look.ambient.r), dim(look.ambient.g), dim(look.ambient.b), 255 });
BeginMode2D(lightCamera);
TrailLights::DrawTrailBand(camera.target.y, look);
SkiLift::DrawLightmap(player.GetPosition().y, look.pylon);
TrailLights::DrawLightmap(player.GetPosition().y, look.mast);
EndMode2D();
EndTextureMode();
// Multiply lightmap over ground & riders, then draw airborne snow + beams
BeginBlendMode(BLEND_MULTIPLIED);
DrawTexturePro(lightmap.texture, srcFlip, fullScreen, Vector2{ 0, 0 }, 0.0f, WHITE);
EndBlendMode();
BeginMode2D(camera);
effects.Draw(look.airborneTint, EffectsManager::DrawPass::Air);
SkiLift::DrawBeams(player.GetPosition().y, renderCfg.nightBeams, look.pylon);
TrailLights::DrawBeams(player.GetPosition().y, renderCfg.nightBeams, look.mast);
EndMode2D();Joining Endless Runs With a Live Chairlift Loop
Runs no longer end at a static finish screen. Chair spacing is rounded so an integer count of chairs wraps the closed cable loop around both bullwheels, feeding riders out of the 360-person base crowd and unloading them onto the summit apron as active CPU skiers and boarders (with one in eight comically wiping out on the ramp).
loopLen = 2.0f * span + 2.0f * kPi * kWheelR;
const float n = fmaxf(4.0f, roundf(loopLen / 310.0f));
spacing = loopLen / n; // whole number of chairs round the cable loop
Vector2 LiftStation::LoopPoint(float u) const {
const float arc = kPi * kWheelR;
if (u < span) return Vector2{ -kWheelR, bottomY - u };
u -= span;
if (u < arc) return Vector2{ -kWheelR * cosf(u / kWheelR),
topY - kWheelR * sinf(u / kWheelR) };
u -= arc;
if (u < span) return Vector2{ kWheelR, topY + u };
// ...At the top wheel house: getting off a chairlift is famously hard.
// u.willFall = Rand(rng) < 0.125f;
}Ground-Plane Hitboxes and Readable White Snow
Sprites stand upright, but collisions happen on the flat snow plane underneath them, so every hitbox and shadow anchors to the tiny footprint where board or trunk meets the snow. Meanwhile, carve spray draws on the ground pass under the rider while high-arcing mast snow guns switch between vivid granular daylight mixes and lit night billows.
inline Rectangle MakeGroundHitbox(Vector2 groundAnchor, float width, float height) {
return Rectangle{ groundAnchor.x - width * 0.5f,
groundAnchor.y - height,
width, height };
}
constexpr float TREE_W = 14.0f, TREE_H = 12.0f; // trunk only, never canopy
constexpr float PLAYER_W = 20.0f, PLAYER_H = 12.0f; // board underfoot (+20px Y)
// Daylight drops dark blue-grey billows in favor of dense ice-blue pixel grain:
c.billowEvery = night ? 14.0f : 0.0f;
c.ratePerSecond = night ? 280.0f : 440.0f;
c.grainKind = fx::Kind::Pixel;How the Pieces Fit Together
Python Art Generators
Build ToolRasterizes 16-angle rider atlases, chunky 3x3 trees, lift terminals, and treeline snow-gun masts alongside the 24x24 ASCII Yeti.
C++17 & Raylib Engine
Game CodeDrives carving physics, range-queried y-sorted world queues, closed-loop chairlift crowds, 5-style night lighting, and procedural PCM audio.
WebAssembly Delivery
60 FPS BrowserPacks world sprites into one 2048x2048 atlas, renders straight to screen at native size, and paces frames via requestAnimationFrame.
Under the Hood at a Glance
| Inspired By | Windows 3.1 SkiFree (1991) |
| Language & Library | C++17 and Raylib 5.5, compiled to WebAssembly with Emscripten |
| UI Architecture | Timber Lodge code-baked pixel UI (src/PixelUi.cpp) on a 427x240 3x grid, zero UI sprite sheets |
| Rider Sprite Layout | 16 board angles x 7 poses (ride, carve, crouch, air, tuck, crash, grab) across 3 HSV-tinted layers |
| Yeti Sprite Grid | 376 frames across 8 directions, typed on a 24x24 pixel grid and upscaled 3x to 72x72 |
| Night Riding (N / F4) | 5 shader-free lighting looks (Classic Pools, Even Wash, Moonlight, Sodium, Crisp Floodlit) + mast snow guns |
| Mountain Loop | Summit clearing, shaped trails (30/70, 80/20, 10/90), 360-rider base crowd, closed-loop chairlift |
| Sound Effects | 16-bit 44.1 kHz PCM audio synthesized in RAM (carve edge hiss, alpine wind, bush thuds, crashes) |
| Play in Browser | https://freeride.dualcorsoftware.com |
Take a Run Down the Mountain
Play Freeride right in your browser. Pick your outfit on the Timber Lodge signboard, toggle night riding with N (and cycle floodlight looks with F4), ride the chairlift between laps, and outrun the Yeti past 2,000 meters.