CADDIE
by Ranjan Bhattacharya
from Home Computing Weekly, 10-16th May 1983


Fore! But Mr Spectrum just can't play the game

It's not fun being a caddie when Mr Spectrum plays golf. You'll find
out why when you type in Ranjan Bhattacharya's game.


You have been employed as a caddie to Mr Spectrum. The trouble is that
Mr Spectrum is a terrible player, but he just won't give up trying.
His shots are usually so bad that the ball nearly always ends up on
the opposite side of a busy road; and, as caddie, you have got the job
of crossing the road to retrieve the stray golf ball and return it to
him.

You are given 500 points for picking up the golf ball and a further
1,000 points for returning it to Mr Spectrum. He is, however, rather
mean. He has warned you that if you manage to get run over he will
not be bothered to take you to hospital more than five times.

You move around the screen by pressing:
	5 to move left
	8 to move right
	6 to move down
	7 to move up

The difficult to read inverse words in the last part of the program
are: "CADDIE", "PRESS C TO CONTINUE" and "PRESS S TO START".


How it works

Most of the game is in subroutines which are called when needed. These
are the main blocks of the program:

  10-  78 initialise variables, check for key input and update score
          accordingly
  80-  85 set up bottom half of screen
  90      checks for collision between caddie and car
 100- 499 scrolls cars left and right; checks whether ball has been
          picked up or returned
 550      sound for collision with car
7000-7090 prints top half of screen
8000-8990 initialise strings to hold traffic
9000-9095 set up all the user defined graphics
9500-9797 general messages and prompts displayed at various stages in
          the game
9900-9920 introduction
9950-9999 instructions


Variables

VT	vertical coordinate of caddie
HZ	horizontal coordinate of caddie
BALL	checks whether golf ball has been picked up
	and also prevents cheating
SCORE	score
HISCORE	highest score
C$	array used to check whether caddie collided with car
LIVES	lives left
A$/B$	strings to store cars

Some other minor variables are also used.

Line 110 moves whatever is stored in B$ one place to the right and
line 120 moves whatever is in A$ one place to the left. I have used
this technique both for the cars and again in lines 9900-9920 to move
the word CADDIE left and right across the screen at the beginning of
the game.


Hints on conversion

To convert Caddie to run on most other computers, all that is really
needed is to alter lines 110 and 120 using LEFT$ and RIGHT$ so that A$
and B$ are moved one place to the left or right.

All lines using INKEY$, particularly lines 60 and 70, should be
modified using the GET$ command.

The colour commands BORDER, INK and PAPER and the commands INVERSE,
FLASH and BRIGHT can be omitted, or replaced by equivalent commands
depending on your machine.

BEEP should also be omitted or replaced with a similar sound command.
SCREEN$ should be replaced by a small subroutine which will do the
same job.

