← All spotlightsPrograms / Features

Spotlight › Gorillas

Gorillas in 8086 assembly

GORILLA.BAS gameplay with fixed-point trajectories, incremental redraw and an optional computer opponent.

Full screen, VGA
Gorillas filling the screen on a dark blue sky. At the top: Kong, Score 000 - 000, Angle 45, Velocity 70 and Wind +004. A yellow smiling sun hangs over a skyline of teal, grey and red buildings with lit windows, an orange gorilla stands on a roof at each end, and a small red arrow under the city points right.
Kong's turn, full-screen on VGA.
Players
1-2
Executable
16,206 bytes
Adapters
VGA / CGA / Hercules

01 / Adaptation and controls

Adaptation and controls

The implementation follows Microsoft's GORILLA.BAS rules and trajectory formula; the reference listing is retained in the source repository. It adds a computer opponent and selectable match length while keeping same-keyboard two-player play.

Angles and speeds are integers. Enter advances fields and throws; Tab switches fields; P pauses and F toggles full-screen. Gravity and wind feed the trajectory calculation. This is native code, not a BASIC runtime.

02 / Game sequence

Game sequence

Title screen
The Gorillas window on the os8088 desktop, blue with a border of small red sparkles. It reads G O R I L L A S, After Microsoft QBasic 1990, and five lines of instructions ending Press any key for setup, with two orange gorillas between them.
Animated title sequence.
Setup
The Gorillas window showing GAME SETUP. It asks Name of Player 1 (10 characters), says Default: Player 1, and has Kong typed in. The bottom line reads Backspace: edit, Enter: next.
Match setup.
Starring
The Gorillas window reading G O R I L L A S, STARRING, Kong AND Computer, with two orange gorillas and the line Press any key to play, inside the sparkle border.
Player introduction.
In a window
The Gorillas window on the desktop with a match in progress: Kong, Score 000 - 000, Angle 45, Velocity 70 and Wind -004 at the top, the sun, a skyline of red, grey and teal buildings with a gorilla on each side, and a red arrow under the city pointing left.
Windowed colour rendering.
In flight
Gorillas full screen with a small yellow banana in the sky just left of the sun, above the skyline and both gorillas. The text at the top has gone.
Incremental banana redraw.
A hit
Gorillas full screen, paused. The top reads Computer, Score 000 - 001, and Paused. P or Enter to resume. A large orange blast fills the spot on the left rooftop where Kong stood; the computer's gorilla stands on the right.
Collision and scoring.
Victory dance
Gorillas full screen after the hit. The top reads Computer, Score 000 - 001, and Point! Next skyline shortly. A bite has been taken out of the left rooftop, and the gorilla on the right has one arm raised.
Victory animation with persistent terrain damage.
Game over
The final scorecard full screen, inside a border of red sparkles: GAME OVER!, Kong 000, Computer 001, Computer wins!, and Press any key for setup.
Completed one-point match.

03 / Physics and dirty rectangles

Physics and dirty rectangles

Fixed-point arithmetic and a sine table replace the BASIC floating-point trajectory. The comparison test permits 0.75 pixel deviation from the reference formula. Sprite save/restore limits a flight update to its affected rectangle; gorilla collision uses the visible pixels.

The recorded XT city-redraw times are below. Input repaint was reduced from an 881 ms first-digit update to 5.6 ms on VGA by redrawing only the edited field. These are measurements of that renderer and test configuration.

The computer player searches candidate velocities incrementally at a fixed 55-degree angle, then applies bounded error. Original tunes use the speaker; optional FM match music is separate.

Time to draw a new Gorillas city on a 4.77 MHz IBM PC
cardin a windowfull screen
VGA1.24 s1.45 s
CGA0.37 s0.33 s
Hercules0.47 s0.52 s

04 / Differences from BASIC

Differences from BASIC

Whole-number angles and velocities only. Physics and timer quantisation are not bit-identical to QBasic output. Two human players share a keyboard; there is no link mode. CGA colour is available full-screen, while the desktop window is monochrome.

05 / Run Gorillas

Run Gorillas

Launch GORILLAS.O88 from GAMES. The 360KB distribution places it on games360.img; the larger software images, live media and The Wire also carry it.