Classic Computer Magazine Archive COMPUTE! ISSUE 36 / MAY 1983 / PAGE 68

Deflector

Frank J. Tyniw

You'll find that this game is quite a brainteaser. Strategically placing your Deflector and predicting a bouncing ball's trajectory is no easy task. If you like realtime strategy, Deflector's dynamically changing playfield will provide hours of challenging fun. (Versions for the unexpanded VIC, Atari 400/800, and Apple II.)

This is an adaptation for the 5K or 8K VIC of Fred Dunlap's Deflection program (from Vol. I, Number 3, PET User Notes). The idea of the game is simple. A ball bounces from side to side or from top to bottom of the screen. Pressing the left arrow key above the control key will print a slash in front of the ball's path, deflecting it 90 degrees. The F1 key will print a backslash (\). Your goal is to deflect the ball into the square targets, using as few slashes as possible to achieve the highest score.

Scoring is ten points for every block hit, minus one point for every slash used and minus five points for every slash on the screen if you hit the panic button. The panic button is the British pound sign (£). If you get too many slashes on the screen or deflect yourself into a corner, hitting the panic button will remove all slashes, subtract five points per slash, and resume the game.

The subroutine at 63000 is a useful utility you may want to include in other programs. When the program starts, it asks "adjust screen? (y/n)". The screen will switch to a black border and white background, and color bars for fine tuning your set. The cursor control keys will move the entire screen up, down, left, or right to adjust for your TV.

Press D when done adjusting, and the program asks if you want instructions. Then it will ask for number of targets. The program then will select random screen locations for the targets (160-200). Lines 700-990 handle the score display and rerun lines. Lines 4300-6210 are the sound routines. This program works on the unexpanded VIC or with the 3K cartridge suggested modifications.

Instead of a block for a target, you could use programmable character functions. The targets could be germs or political symbols, or instead of a ball you could use up, down, left, and right darts, arrows, anything.

A typical game of "Deflector," VIC version. (Other versions use similar character graphics.)

Program 1: VIC Version

10 PRINT "{CLEAR}" : TR = 208 : J = 3 : BC = 36879 : VO = BC - 1 : S4 = BC - 2 : S3 = BC - 3 : S2 = BC - 4 : Sl = BC - 5
20 GOSUB63000 : POKEBC,93 : V = 15
122 PRINT" {DOWN} INSTRUCTIONS? (Y/N)
123 GETV$ : IFV$ = ""THEN1 2 3
125 IFV$ = "Y"THENGOSUB1000
130 PRINT" {CLEAR}"CHR$(142)
140 K = 0 : T = 0 : CL = 5
142 INPUT"{DOWN}HOW MANY TARGETS"; J : J = ABS(J)
144 IFJ >506 THENPRINT"TOO MANY!" : GOTO142
146 IFJ <10ORJ> 200THENPRINT"{DOWN}BRAVE, AR
EN'T YOU?"
155 FORI = lTO1000 : NEXT PRINT"{CLEAR}" : GOSUB 7000
157 SS = 7680 : SR = 38400
160 FORI = 1TOJ
170 A = INT(506*RND(1))
180 IFPEEK(SS + A) = TRTHEN170
185 POKES2, 0 : POKES3,0
190 POKESS + A, TR : POKESR + A,6 : GOSUB4300
200 NEXTI
205 POKES2, 0 : POKES3, 0
210 A = INT(506*RND(1))
230 U = A + SS
240 DI = 1 : IFRND(1)>.5THENDI =  - 1
300 GETX$
310 IFX$<>""THEN600
320 NE = U + DI
330 IFABS(DI) = 1 THEN430
340 IFDI>0THEN380
350 IFNE<SSTHENDI =  - DI : GOSUB6000 : GOTO320
355 A = NE
360 IFPEEK(A) = 77THENDI =  - 1 : NE = NE - 1
370 IFPEEK(A) = 78THENDI = 1 : NE = NE + 1
375 GOTO530

Notes On The Atari And Apple Versions

For the Atari, use the two keys with slashes on them (the plus key and the question mark) to place your slashes. The ball will deflect at a 90 degree angle. When the game begins, you should hold down [SELECT] and the screen will start to fill with targets. Let go when you think you have enough.

For the Apple, enter the number of targets you want to play with. Very few or very many targets makes for a difficult game. Use the left and right arrow keys to lay down slashes.

For either the Atari or Apple, use the ESCape key as the panic button if your ball gets trapped.