1988 · Blade Software

Laser Squad

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/spectrum/laser-squad with me to Gold.

Every unit of the five scenarios in its eight facings, by what it holds; how they die, strike, get hit and spark, at the game's own pace; every object; and every tile each scenario carries.

01 · The units

Every unit has eight facings, and what it holds changes its tile

Pick a scenario: every section of this page shows its shapes.

Each tile drawn by the Play tab's port of drawTile ($60AF) from the scenario's own tiles at $E8DF, in the colours the scenario's table of squares gives the unit. A row lists the things a unit can hold that give it those tiles; point at a tile for its number.

A unit stands on the map as its own byte, $8C to $9F, and its entry in the scenario's table of squares holds its colours and its tile. Each time the unit turns, or takes something into its hands or puts it away, setUnitTile ($6D10) writes a new tile there. The unit's kind, its first byte, picks a list of 32 at the address in $B71C; the list gives a row for empty hands and one for each kind of object; and the row, eight bytes at the address in $B71E, gives the tile for each facing, from up round clockwise.

Many kinds of object share a row, so a scenario draws only a handful of ways of holding something. In Moonbase Assault and Rescue from the Mines every row of a kind has the same tiles for up, up and right, and up and left: turned away, a unit shows nothing of what it holds.

02 · What moves on the view

A death, a blow, a hit and the sparks, each paced by its sound

Pick one to play it on the scenario's map, with its sound, at the speed the game shows it.

The Play tab's port of each routine (deathShow $83A6, blowShow $7F98, hitShow $8371, sparks $9475 and explode $9696) run on the scenario as play starts, on the square in the middle of the view. A picture is taken each time the game's clock has moved on by one of the Spectrum's frames, fifty to the second, and the pictures are played at that rate, with the routine's writes to the beeper played by the site's model of it.

The game turns the Spectrum's interrupts off and never turns them on again, so nothing on the view moves by the frame. Each change is drawn and then held while a sound effect plays, and the length of the sound is the animation's pace. A dying unit turns on the spot a facing at a time to the sound of effect 12, and falls in three tiles from the scenario's table at the address in $B720. A blow flashes the scenario's list of tiles at $B64E over its target. A hit flashes two tiles in yellow, once for every four points of damage.

The sparks are not tiles. Each is a cross of five dots, flipped onto the screen and off again as it moves by its own step from a table at $954E, with a click from the beeper for every dot. A shot that stops throws 16 of them; a blast throws 49 or more, after flashing the view's colours three times, and fades them as the sparks fly.

03 · The objects

Every object has a tile, and fire mode draws none of them

Each kind of object, from $6E on, drawn from its entry in the scenario's table of squares at $E65F.

An object lying on the map is its kind's byte, $6E and up, in place of the floor, and the scenario's list of objects keeps the floor it lies on. In fire mode's table of squares every kind of object, in all five scenarios, has tile 0, which has no pixels set: on the plan a weapon on the floor is an empty square.

04 · Fire mode

In fire mode a unit is a blob, and the crosshair is 21 dots

The units' entries in fire mode's table of squares ($E79F), and the crosshair drawn by the port of drawCrosshair ($8B7A) on an empty view.

Fire mode draws the map through the second table of squares, in which the units are blobs, so the line of a shot shows against plain ground. The crosshair moves by pixels, sixteen to a square, and is no tile: drawCrosshair flips 21 dots, listed as steps from the crosshair's pixel in a table at $8B50, and flipping them again takes it off. The shot itself is a single dot drawn along its line one pixel at a time, each with its sound, and taken off again the same way.

05 · The map's squares

The rest of a scenario's tiles draw its map

Point at a tile.

Each tile in the colours of the first square that draws it, and in white on black when nothing does. The units, the objects, the blobs, the falling bodies, the blows and the hits are in the sections above, so they are left out here.

The tiles fill the end of each scenario's block from $E8DF, 32 bytes each: the top left cell's eight bytes, then the top right, the bottom left and the bottom right. Terrain, objects, units, the falling bodies, the blows and the hits all draw from the same set, so each scenario has its own look. The sheet stops at the highest tile any table of the scenario names.

06 · The screen

Tiles of two cells by two never clash

The Spectrum has one screen mode: 256 pixels by 192, and a byte of colours for each cell of 8 by 8, an ink and a paper. Laser Squad lays its map on that grid. A square is a tile of two cells by two, and its entry in the table of squares gives all four cells the same colours, so nothing on the view ever bleeds into its neighbour (drawSquare, $616E).

The view is the 11 by 11 squares at character rows and columns 1 to 22, inside a frame whose bottom edge carries the turn and the victory points. The column to the right of it, from character column 24, holds the readout of what is under the cursor, the menus and the selected unit's panel. All text is the game's own font of 8 by 8 at $B139, one character at a time (printChar, $6072), and the large words of the readout are the same font at double height.

The scanner, option 3 of cursor mode, gives the whole screen to the map: it clears it to blue and draws every one of the 80 by 50 squares as a pattern of dots three pixels apart, the pattern each square's byte names in a table at $D2FF, with the units' squares and the view's frame flashing until fire is pressed.

07 · The loading picture

Three troopers, unseen for 41 seconds

The loading picture is three armoured troopers drawn in blue on white under the LASER SQUAD logo. The screen is black while its bitmap comes in, all but the bottom two rows of cells, which are white on black: there the picture shows a line of pixels at a time. After 41 seconds the colours sweep down the screen a row of cells at a time.

The tape's own bytes, at its own pace from the picture's first byte, 20 seconds into the tape. The blue and yellow stripes are the Spectrum's own loader at work: it turns the border over at every edge of the tape's signal, so each stripe is one pulse, a thin one a 0 and a thick one a 1.

The picture takes 45.7 seconds. Most of its bits are 1s, the white of the drawing, and a 1 takes twice as long on the tape as a 0: the same 6,912 bytes all 0s would load in 27 seconds, and all 1s in 54. It stays up while the game's code loads after it.