1988 · Mastertronic

Double Dragon

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

A fighter’s shirt and legs share the same hardware sprites. The game swaps their shapes as the screen is drawn.

Watch the enemy poses change

Animation
Enemy sprite animation.

Pose script in the listing

An enemy’s type, action and direction choose a sequence of poses. A pose picks four shapes for the two halves of the body. Change the stage from Garage to Forest in the starting example. The upper pieces change and the legs keep the same shape.

The preview holds a pose for the same number of PAL video frames as the game’s interval table. Action 2 holds for 16 frames in the first enemy slot and 15 in the second. During play the enemy update can change the action or override the interval.

Step through the player’s moves

Fighter animation
Player sprite animation.

Move code in the listing

The first fighter’s move table and the second fighter’s table choose the code for each action. The moves select a new set of sprite pieces as the action advances. Both disks produced the same poses and durations for each move outside the garage. Compare Jump left and Jump right to see the mirrored poses. The preview keeps the fighter centred so you can compare the shapes.

Four shapes make one fighter

Visible pieces
Opening pose with separate colour and outline layers.

Loading the shape records from the listing.

Each half uses two hardware sprites in the same place. The black outline can draw a single pixel. The colour layer draws in pairs of pixels but has three colours to work with. Turn either layer off to see what it contributes.

The game draws the upper pair first. The routine at $3003 reuses the two sprite slots below the waist. It changes their shapes after scanning the top 19 lines of the actor, then positions the lower pair two lines later. The original instructions mention a gap at the waist. The preview places the two halves 21 pixels apart. In play the point where the hardware switches determines what shows at the waist.

The outline and colour shapes for this pose are at $EE40 and $EE00 for the top, and $E8C0 and $E880 for the bottom.

Shape pieces stored on disk

One stored pair of VIC sprite shapes.

Shape bytes in the listing

Most shape pieces stay in memory. Three of the level files replace the slots starting at $D000. The C64 can talk to its chips at those addresses while the video chip reads picture data from the same locations in RAM.