BAGATELLE
from Home Computing Weekly, 16th August 1983

The trophy's yours if you win at Bagatelle

Here's the computer version of that old favourite, Bagatelle. Written
for the Spectrum by Thomas Goodchild, it gives you a choice of three
speeds and bonus points. There's even a trophy for a high score.


My game is based on Bagatelle, works on both models of the Spectrum and runs
in a choice of three modes: fast, rapid and slow. In the slow mode you can
gain bonus points, but be careful not to stray off the right track and into
the minefield. For all modes you have 10 goes, with an extra go each time you
hit the 100. The object of the game is to score 1,000 points; and then your
reward, a trophy, appears on the screen.

The highest score so far is retained and displayed continuously. I have used
the full 24 lines of the Spectrum's screen and all the 21 user-defined
graphics characters. There is no machine code as such. The data for the 21
UDG characters - lines 6010-6017 - is entered in hexadecimal (base 16) to
save a lot of programming time and avoid the need for all the commas. Each
line is labelled with the characters it contains.

Lines 6018-6040 contain the hex loader, which is a modified ZX81 routine. If
you change the program and use fewer UDGs, don't forget to change the number
21 in line 6018 to the new number of characters. To see the positions of
hazards and bonus points change the INK colour in lines 2015 and 2515.

In line 3040 the graphics characters, in order, are: B C D E F G H I
(GRAPHICS 8) J K L M N O P Q R S T (GRAPHICS 3) U. A is the ball.

If you want to see the Trophy, use the direct instruction GOSUB 3040.


How it works
  10-115   initialisation, call subroutine to set up graphics, draw board
 120-400   move ball routine
1000-1602  score routine, option to replay
3020-3060  win routine, display trophy
4020-4060  move routines
4300-4600  instructions, select speed, display
6000-6050  UDG DATA and loader


Variables
go         counts tries, maximum 10
score      counts and records score
hi         records and displays high score
b          vertical co-ordinate of ball - moves down automatically during play
d          horizontal co-ordinate of ball - fired by pressing M and continues
           to move swiftly and smoothly after release (when in mode F)
line       calls sub-routine to set speed: F,R,S
a,b/aa,bb  coordinates of random hazards/bonus points in SLOW game
d,e,x,r    used to produce BEEPs and colour effects
