HI-RISE HIVE
by Dave Rogers & Colin Hogg
from Your Computer, June 1984


HIGH-RISE HIVE

A program with a sting in its tail provided by Dave Rogers and
Colin Hogg - best possible use is made of the ZX-81's limited
graphics.


FOR ANY ZX-81 owners who are feeling forgotten and unsupported,
Hi-Rise Hive provides a professional quality, fast, and addictive
game, featuring progressive difficulty from easy to almost impossible
and up to 20 independently roaming bees.

The player is also cast as a bee, but one that is trying to monopolise
the honey by taking it from the cells of a multi-storey hive. The
other bees of course, being the socially responsible creatures that
they are, are busy, constantly refilling the empty cells, but are
understandably peeved about having to do this and so will 'sting' you
given the opportunity.


Behaviour is realistic

The movement algorithm has been designed to make their behaviour as
realistic as possible. For example, if you are near one and sit still
it may just go away, on the other hand one may decide to chase you
quite a distance along a gallery, forcing you to jump off. Note that
you can always jump off or slide down the outside of the hive but the
only way up is via the internal ladders.

In fairness to Nature we wouldn't want to induce Apiaphobia in
anybody, especially any younger readers, so don't forget that bees
will not normally bother you if you don't bother them. If you are
unlucky enough to encounter the subspecies 'Adansonii' this may not
apply but fortunately this aggressive strain is not native to Britain.

The hive is almost five screens in size, one third of which is
underground labyrinth. It is all held in one rather huge string, so
you will only ever see a certain section at a time starting at the
top, but those with ZX printers can cheat and see the whole lot simply
by typing:
	LPRINT H$

If you can clear out every cell on a given screen then you proceed to
the next section, the hive becoming wider and more and more bees
appearing at each successive level. By the time you reach the
underground section, the maximum of 20 bees will have been reached and
the screen will be literally a hive of activity.

If you should manage to clear the final screen you then start at the
top of the mega-hive, and we really do not envisage any player being
able to clear more than a few screens of this - in the rare event of
completing the mega-hive you will go on to an even wider
mega-mega-hive and so on.

For variety, the layout of honey cells is random each game you play,
but it is designed to tend towards more interesting structures. For
example, there will often be clusters of cells where bees can enter,
and by depositing 'honey' behind them, trap themselves in. These
situations are of course somewhat dodgy to try and clear out since the
entombed bee, although it looks dormant, is in fact bursting to get
out! You may have to let it out sooner or later to clear the screen.


Crash can occur

Essential addresses in this program are:

Spare byte 16508- This is used to store the character of whichever
square the player next intends to move onto. It is used by both the
Basic and the machine code, for replacing characters when the man
moves (line 30) or is hit by a bee (hex 410F).

Spare byte 16417 - Holds the number of active bees, from zero up to
20. It is Poked by line 510 to vary the number of bees flying on
different screens. Beware: a crash can occur if it is Poked much above 20.

USR 16514 - Sets up bees in their start positions at top of the screen.

USR 16546 - Moves each active bee one space, does 'screen cleared'
scan and checks if player has been hit. Normally returns to Basic with
line number 10, but returns with line number 600 if the player has
been hit, or with 300 if the screen has been cleared. The Basic then
'goes to' one of these lines.

USR 16749 - This routine is equivalent in Basic to:
	Let score = score + 2
	Print at 23,15; score
	Goto 50
It is however, much faster and it formats the printing with leading
zeros to allow a rapid count-up visual effect. The score is held only
on the screen, not in a variable, and screen positions (23,15) to
(23,20) must start off as six zeros.


Listing Includes hex loader

The main listing includes the hex loader, so type in all the Basic
first, not forgetting the first four REM lines as detailed below. Then
RUN 9000 and enter the Hex data one line at a time, including the
check figures but not the spaces.

Line 1 must be typed in as REM followed by exactly 103 characters -
any will do. The line number of this is then edited to 2, 3 and 4 to
produce four identical lines, making available a total of 432 bytes
for the machine code. You only actually have to type in 280 of these
via the hex loader, the remainder are left for use as 'stores' where
the machine code routine will eventually hold information on
individual 'bees'.

The self-checking hex loader given is as near foolproof as you can
get; it simply will not let you enter wrong data or lines in the wrong
order. The check figures consist of the sum of each line of hex data
plus 20 times the line number. It is statistically highly improbable
that exactly equal- but- opposite errors would occur, cancel out, and
admit incorrect data. When finished, the loader will remind you to
tape a back-up copy of the program, in case it crashes when RUN.

Once you are satisfied that the program is working properly the hex
loader lines can be deleted and some final copies taped. Remember that
the ZX-81 Saves its variables along with the program and H$ is rather
a huge string to unnecessarily save on tape! So always use GOTO 9990,
as this includes a CLEAR before autosaving, reducing save/load time by
over two minutes.


Importance of graphics

It is most important to realise the importance of the graphics
characters used, particularly the greys. The grey on key A is Outside
Grey in which bees are triggered to move diagonally for four moves -
or until they hit something - then change direction, giving an erratic
bee-in-flight motion. The player however will fall through Outside
Grey until another object is hit. The grey on key H is Inside Grey and
in this the bees are triggered to move horizontally and vertically so
as to wander along the passageways. The player can move freely through
Inside Grey.

Please double-check the following lines:

870	Inside grey (key H)
940	Outside grey (key A)
950	Outside grey (key A)
9999	Outside grey (key A)
630	inverse word 'strings' (backwards!)
830	various combinations of graphic shift
	G and inverse spaces: "is, 2gg, 2is, gg,
	3is, 4gg, 3is, 3gg, 2is, 2gg, 3is, 3gg,
	2IS, gg, 2is"
890	Inverse Hs
950	Outside grey and inverse H
960	inverse H, three inverse spaces,
	graphic Shift V, three inverse spaces,
	graphic Shift V, three inverse spaces,
	inverse H.
980	graphic Hs
992	six graphic Shift Vs. Second string
	contains graphic Hs and g. Shift Vs.
1040	g. Shift H, three g. Shift Fs, (4 g. Shift
	G, 4 g. Shift F) x 3, 3 g. Shift G, g. Shift
	H.
460	g. Shift Vs.

Line 9999 must contain 32 letters, then 64 graphic shift As.


Note trigger characters

Note that Colons (Shift Z) are used as trigger characters in lines
1070, 1090, 1130 and 1150; there should be six colons in total.

Line 10 The first check uses 'greater than' but the rest use equals.
This is to allow the use of either key 'Z' or key 'X' for 'left' so as
to be comfortable on both original and full size ZX-81 keyboards.

If you don't feel like typing the program in, the authors can supply a
good quality taped version. Send #2.50 to: [address removed]


Main variables                              to hive string.
S    Screen position of player.        U$   Utility string (general purpose).
IP   Intended position (players next   TY   Type of line to be added; eg.
     move).                                 honey cells, empty cells,
DK   Deck level of hive (0 to 60).          passageway.
MC   Machine code subroutine calls.    HW   Half-width (no, not half-wit!),
STGS Strings (0 to 30).                     determines slope to sides of
H$   Hive string.                           hive. Increases with T and N so
E$   Empty string - actually contains       hive gets wider on successive
     spaces and minuses.                    levels.
SDF  Start of display file.            K    Ladder positions.
Hive construction variables.           G$ } Used in construction of
A$   Assembly string in which lines    T$ }
     are built up before being added   B$ } underground section.

