1989 · MicroStyle

Stunt Car Racer

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/stunt-car-racer with me to Gold.

The race is drawn in lines, but the parts of the car that move on their own are sprites: the front wheels, which turn as fast as the engine runs, and the boost's flame, which jumps from one pair of exhausts to the other every frame.

01 · The cockpit

The wheels turn with the engine, and the boost flickers

The front wheels' tops are sprites with three pictures each, stepped on by the engine. The flame is two sprites, at the left exhausts in one frame and the right in the next.

The frame is from a practice race on Little Ramp, as the Play tab's game shows it, with the view's sprites put back by this page. Each frame the raster interrupt adds the engine's note ($5D, higher the faster the car goes along the road) to a count ($5F), and each time the count passes 255 it steps both wheels' top halves on a picture (WHEELS_TURN, $FFB1): the right wheel's sprite through $60-$62 and the left's through $67-$65, the other way round while the car goes backwards. While the boost burns, the interrupt alternates the flame between the two pairs of exhausts, from its table at $CF56, with two more pictures used while the other of the view's two bitmaps is on show. Here the view's bitmaps swap every seven frames, about as often as a pass of the race comes on the flat.

02 · The opponent

The other car is drawn in lines, like the track

The opponent's car is a box on four wheels, worked out from its four corners each time it is drawn, so it turns as it comes past.

Frames of the first race of a season on Little Ramp, every fourth, from the Play tab's game. DRAW_OPPONENT ($E1B1) projects the car's four corners onto the screen, and draws its frame, its end, its sides and its roof from them with the line drawer the track uses, the nearer side last; its wheels are boxes at the corners. When the car is partly behind the track ahead, its lines go into the fill's tables first, so that the road hides what it should.

03 · The screen

One screen, split three times a frame

The race screen is a high-resolution bitmap that the raster interrupt changes on its way down, so that the view and the dashboard can come from different places.

  • line $3DThe view: the bitmap shown is the one at $4000 or at $6000, whichever is not being drawn ($C35F), in multicolour sprites. Sprites 2 and 3 are the bottoms of the front wheels and 5 and 7 their tops; while a message is up, sprites 0 and 1 carry it at the top until line $64, and while the boost burns, the flame.
  • line $C5The dashboard: always the bitmap at $6000, so that the game draws the dashboard once and the view can be drawn into the rest.
  • line $D7The dashboard's sprites: 0 to 3, high resolution and black, are the panels of the lap, the best lap and the clocks, whose figures the game draws into them. The interrupt also moves the engine's note on, plays the sound effects' frame and turns the wheels.

The raster interrupt ($CDAA) sets the line of the next band each time it runs. In the menus it splits the screen differently, in multicolour above and high resolution below ($CD5C).