1989 · Activision · Tracks

Power Drift

This minisite was contributed by air. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/power-drift with me to Gold.

Five courses of five stages. Each stage is a few bytes in a course record: a list of track pieces, a list of roadside objects, two colours, two horizon pictures, and whether the track starts high off the ground.

01 · Drive a course

Drive any stage from the start line round to the start line

Pick a stage and the view runs a lap of it, 400 steps of track, then goes on to the course's next stage until the fifth is done. There are no karts: only the road, the roadside and the horizon.

The view is drawn by the game's own routines, from the listing's bytes, on the site's model of the 6502 processor. setup_stage ($3558) sets the stage up. Then each race frame does what race_frame_loop ($08AC) does: when the kart has moved on a step, track_step, scenery_tick and bend_drift, then clear_view, draw_horizon_rows, draw_road and draw_scenery into the back screen, the flip, and copy_colours. Two things differ from a race. The kart is held in the middle of the road ($2F = $E0), as if steered perfectly, and its speed level ($536F) is the slider's, which adds 7 km/h a level. The slider stops at level 10, 70 km/h, because a kart any slower falls at the first jump (piece_jump). The page draws the screen just drawn in the view's multicolour characters, with the sky colour above the line where the timer changes it ($23) and the ground colour below. It runs a race frame every three video frames, about 17 a second, as the game does at its fastest. test_course.js runs the game's own race_frame_loop beside it on the kit's simulator, with the same two things standing in for move_player, and checks every character and colour of the view, frame by frame, for a whole lap of every stage.

02 · Every stage

A stage is a list of pieces and a list of scenery

Each of the 25 stages, drawn from its course record: its horizon, the pieces of one lap, and the objects along the road.

The horizon

The stage's two horizon pictures, the whole 80 columns of each, as draw_horizon_rows copies them at the start of a stage: the upper one with its bottom row on screen row 9, the lower one on row 15, in the stage's sky and ground colours and its view multicolour. A bend scrolls them sideways a column a step, and a hill moves them up and down. Their characters $F1-$FE are the set setup_stage copies in for the stage: from $B785 when the lower picture is the one at $A571, otherwise from $B685.

One lap

The stage's piece list, each piece as long as the number of steps its routine runs for, with the bend above it: 9 notches either way from straight, left upward. A lap is about 400 steps; the list starts again from the top at its end.

Along the road

Every kind of object the stage's scenery list names, in the order it first appears, drawn at distance 6 with the block of character shapes the list has loaded by then, in the stage's colours.

A course record (course_a and the four after it) holds two bytes for each stage in six groups: the piece list, the scenery list, a raised-track count with the view's multicolour, the sky and ground colours, and the two horizon pictures. setup_stage reads them at the start. The pieces are described on the How it works tab; the scenery list is a run of streams, each four records of an object on the left, one over the road and one on the right, with now and then a block of character shapes to copy into the race set before the next.

A raised-track count above 0 at the start means the stage begins high off the ground, where a kart that leaves the road falls. Climbs add to the count and the pieces that level out take from it.

03 · All stages

Twenty-five stages side by side

The numbers behind each stage, from the five course records and the 25 piece lists.