Gobbler

Type
Game
Category
Maze chase game
Author
Sydney Brown
Published in
ACE Newsletter (Atari Computer Enthusiasts, Eugene, Oregon), August/September 1982; later on the BELLCOM public domain disks
Year
1982
Language
Atari BASIC
Requirements
Any 8-bit Atari with 16K+ and Atari BASIC; joystick in port 1
A white-walled GRAPHICS 2 maze filled with yellow nuggets, a blue glob in the middle and the yellow smiley player on the right

About the program

Gobbler is a pure-BASIC maze-chase game that Sydney Brown "gave to ACE members". The REM header dates it August/September 1982. The gold in the maze belongs to the globs, and they aren't happy that you're taking it. Your smiley has four lives to clear as much gold as possible. Each nugget is worth 1 point. A bag of gold that turns up now and then is worth 20, and clearing a maze earns a 100-point bonus and a harder level. The instructions sum it up as "you try to collect all the gold you can before you are caught". The program later went into the BELLCOM public domain library.

What you need

Any Atari with Atari BASIC and 16K or more, plus a joystick in port 1. While the character set is copied, a buzzing tone plays for a few seconds. That's the program setting up, not a fault.

Typing it in

  • The listing is plain ASCII apart from {CLEAR} in line 15 (ESC then SHIFT-CLEAR, or just type ? CHR$(125)).
  • Many statements in lines 300–380 look almost the same. They differ only in +1/-1 and in H(N)/V(N). These lines are the globs' brains, so check them carefully.
  • Line 190's status line. The REM at the end of line 190 says the PRINT string should contain the words SCORE and LEVEL and the characters JJJJ in inverse video. In the copy reproduced here only "0 1" survives. The game runs without the labels, but you won't see your remaining lives. To restore them, make the string 20 characters long: inverse SCORE, 0, four spaces, inverse LEVEL, 1, then inverse JJJJ. Each J is drawn as a smiley, one per life, and line 196 blanks one out each time you're caught.
  • GAMEHHHHOVER in line 410 is right too: H has been redefined as a box shape.

How to play

Press START at the title page. Move the smiley with the joystick. It can wrap from one side of the maze to the other through the gap in the middle row. Odd levels use a walled maze and even levels an open field of gold. More globs join the chase as the levels go up (one on levels 1–2, two on 3–4, and so on, up to five). From level 11 extra blocks appear on the screen. Being caught costs a life, and after four the game is over. Press START to play again.

How it works

  • Redefined characters in GRAPHICS 2. Lines 100–105 lower RAMTOP by two pages, copy the ROM character set there, and replace six characters with DATA from lines 1000–1009: the wall block, the glob, the smiley, the nugget, an explosion and the money bag. In GRAPHICS 2, adding 128 to a character code or using lower case changes its colour, so COLOR 234 plots the smiley and COLOR 235 a nugget, each in its own colour.
  • No arrays for the maze. The screen is the maze. LOCATE reads the character ahead of a mover and PLOT moves it, so walls, gold and players are all just character codes.
  • Simple chasers. Each glob (lines 300–389) first tries to close the gap to you vertically or horizontally, then tries the other two directions. It remembers the character it's standing on in C(N), so it doesn't eat your nuggets. CY cycles through the globs, so only one moves per pass, and on the early levels short delay loops slow things down.

Listing

6 REM *********************
7 REM **     GOBBLER     **
8 REM **       BY        **
9 REM **  SYDNEY BROWN   **
10 REM **    AUG/SEPT 82  **
11 REM *********************
15 ? "{CLEAR}":DIM C(5),H(5),V(5)
20 POKE 710,224:POKE 709,12:? "      ":? "      |     G O B B L E R     |"
22 POKE 752,1:? "      ":?:? "YOU ARE INSIDE A MAZE COLLECTING GOLD"
23 ? "NUGGETS,BUT YOU HAVE A PROBLEM.":? "THE GOLD YOU ARE COLLECTING IS NOT":? "YOURS,IT BELONGS TO THE GLOBS."
25 ? "AS YOU CAN IMAGINE THE GLOBS ARE NOT":? "AT ALL PLEASED AND TRY TO CATCH YOU."
27 ? "YOU TRY TO COLLECT ALL THE GOLD YOU":? "CAN BEFORE YOU ARE CAUGHT !!!":?:? "EACH LEVEL IS MORE DIFFICULT"
28 ? "YOU HAVE 4 CHANCES TO COLLECT THE GOLD";
29 ? "USE JOYSTICK 1 TO CONTROL YOUR SMILEY":? "EACH NUGGET SCORES 1 POINT & THE BAG":? "OF GOLD SCORES 20"
32 ?:? "A BONUS OF 100 FOR A COMPLETED MAZE":?:? "BY SYDNEY BROWN-FUN-CO  ":? "GIVEN TO ACE MEMBERS"
40 ? "PRESS START TO START THE GAME";:POKE 53279,0
50 IF PEEK(53279)<>6 THEN 50
100 POKE 106,PEEK(106)-2:GRAPHICS 18:? #6;"     "
101 POKE 710,140:POKE 708,14:POKE 709,236:POKE 711,222:A=PEEK(106)*256:FOR B=0 TO 511
102 IF B>319 AND B<352 THEN READ D:POKE A+B,D:NEXT B
103 IF B>367 AND B<376 OR B>383 AND B<392 THEN READ D:POKE A+B,D:NEXT B
105 ZZ=PEEK(57344+B):POKE A+B,ZZ:SOUND 0,ZZ,10,8:NEXT B:POKE 756,PEEK(106)
190 X=19:Y=0:AX=0:L=1:S=0:POSITION 0,0:? #6;"0    1":REM "SCORE AND "LEVEL" AND "JJJJ" IN INVERSE
194 COLOR 234:PLOT X,Y:H=9:V=0:ND=0
195 ON L GOSUB 900,920,900,920,900,920,900,920,900,920,900,920,900,920,900,920,900,920,900,920,900,920,900,920
196 COLOR 32:PLOT 16+AX,0:POSITION 15,0:? #6;L;:IF L>10 AND L/2<>INT(L/2) THEN COLOR 72:PLOT 0,6:PLOT 19,6:ND=2
197 EX=22:X=18:Y=6:CY=1:COLOR 234:PLOT X,Y:IF L>12 THEN COLOR 72:PLOT 10,3:PLOT 10,9:ND=ND+2
198 H(1)=1:V(1)=6:C(1)=235:H(2)=10:V(2)=10:C(2)=235:H(3)=6:V(3)=2:C(3)=235:IF L>14 THEN COLOR 72:PLOT 2,6:ND=ND+1
199 H(4)=18:V(4)=3:C(4)=235:H(5)=9:V(5)=6:C(5)=235:IF L>16 THEN COLOR 72:PLOT 14,6:ND=ND+1
200 ST=STICK(0)
201 IF ST=11 AND X<1 THEN LOCATE 19,Y,Z:IF Z=32 OR Z=235 OR Z=112 THEN GOSUB 600:X=X-1:IF X<0 THEN X=19
202 IF ST=11 THEN LOCATE X-1,Y,Z:IF Z=32 OR Z=235 OR Z=112 THEN GOSUB 600:X=X-1:IF X<0 THEN X=19
203 IF ST=7 AND X>18 THEN LOCATE 0,Y,Z:IF Z=32 OR Z=235 OR Z=112 THEN GOSUB 600:X=X+1:IF X>19 THEN X=0
204 IF ST=7 THEN LOCATE X+1,Y,Z:IF Z=32 OR Z=235 OR Z=112 THEN GOSUB 600:X=X+1:IF X>19 THEN X=0
206 IF ST=14 THEN LOCATE X,Y-1,Z:IF Z=32 OR Z=235 OR Z=112 THEN GOSUB 600:Y=Y-1
208 IF ST=13 THEN LOCATE X,Y+1,Z:IF Z=32 OR Z=235 OR Z=112 THEN GOSUB 600:Y=Y+1
209 IF ST<>15 THEN COLOR 234:PLOT X,Y
220 EX=EX+1:IF EX>100 THEN H=INT(RND(0)*17)+1:V=INT(RND(0)*9)+1:LOCATE H,V,Z:IF Z=32 THEN COLOR 112:PLOT H,V:EX=0
222 IF EX=20 THEN COLOR 32:PLOT H,V:COLOR 234:PLOT X,Y:POKE 77,0
250 CY=CY+1:IF CY>5 THEN CY=1
251 ON L GOTO 268,268,266,266,264,264,262,262,260,260,260,260,260,260,260,260
260 IF CY=5 THEN N=5:GOSUB 300:GOTO 200
262 IF CY=4 THEN N=4:GOSUB 300:GOTO 299
264 IF CY=3 THEN N=3:GOSUB 300:GOTO 299
266 IF CY=2 THEN N=2:GOSUB 300:GOTO 292
268 IF CY=1 THEN N=1:GOSUB 300:GOTO 290
290 IF L=1 OR L=2 THEN FOR W=1 TO 10:NEXT W
292 IF L=3 OR L=4 THEN FOR W=1 TO 5:NEXT W
299 GOTO 200
300 IF Y>V(N) THEN 350
301 IF X<H(N) THEN 325
302 IF Y<V(N) THEN 375
303 LOCATE H(N)+1,V(N),Z:IF Z=234 THEN 400
304 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):H(N)=H(N)+1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
305 LOCATE H(N),V(N)+1,Z
306 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):V(N)=V(N)+1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
307 LOCATE H(N),V(N)-1,Z
308 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):V(N)=V(N)-1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
309 RETURN 
325 LOCATE H(N)-1,V(N),Z:IF Z=234 THEN 400
326 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):H(N)=H(N)-1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
327 LOCATE H(N),V(N)+1,Z
328 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):V(N)=V(N)+1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
329 LOCATE H(N),V(N)-1,Z
330 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):V(N)=V(N)-1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
339 RETURN 
350 LOCATE H(N),V(N)+1,Z:IF Z=234 THEN 400
351 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):V(N)=V(N)+1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
352 IF H(N)<19 THEN LOCATE H(N)+1,V(N),Z
353 IF (Z=32 OR Z=235) AND H(N)<19 THEN COLOR C(N):PLOT H(N),V(N):H(N)=H(N)+1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
354 LOCATE H(N)-1,V(N),Z
355 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):H(N)=H(N)-1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
369 RETURN 
375 LOCATE H(N),V(N)-1,Z:IF Z=234 THEN 400
376 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):V(N)=V(N)-1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
377 LOCATE H(N)+1,V(N),Z
378 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):H(N)=H(N)+1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
379 LOCATE H(N)-1,V(N),Z
380 IF Z=32 OR Z=235 THEN COLOR C(N):PLOT H(N),V(N):H(N)=H(N)-1:COLOR 201:PLOT H(N),V(N):C(N)=Z:RETURN 
389 RETURN 
400 PP=PEEK(106)*256+332:POKE PP,189:POKE PP+1,195:POKE PP+8,231:FOR W=0 TO 160 STEP 10:FOR WW=W TO W+20 STEP 2
401 SOUND 0,WW,10,10:IF WW>W+9 THEN COLOR 106:PLOT X,Y
402 IF WW<W+10 THEN COLOR 234:PLOT X,Y
404 NEXT WW:NEXT W:AX=AX+1
405 COLOR 238:PLOT X,Y:FOR W=250 TO 5 STEP -7:SOUND 0,W,2,14:NEXT W:COLOR 32:PLOT X,Y
408 POKE PP,195:POKE PP+1,189:POKE PP+8,153:SOUND 0,0,0,0
409 IF AX<4 THEN 194
410 COLOR 238:PLOT X,Y:POSITION 4,11:? #6;"GAMEHHHHOVER":POKE 53279,0
412 FOR W=1 TO 100:NEXT W:FOR WW=1 TO 3:FOR W=0 TO 255 STEP 2:SOUND 0,W,10,10:SOUND 1,255-W,10,10:NEXT W:NEXT WW
415 SOUND 0,0,0,0:SOUND 1,0,0,0
420 IF PEEK(53279)<>6 THEN 420
421 POSITION 0,0:? #6;"]":GOTO 190
500 L=L+1:POSITION 15,0:? #6;L
599 GOTO 194
600 COLOR 32:PLOT X,Y:IF Z=32 THEN RETURN 
605 IF Z=112 THEN 620
610 SOUND 0,49,10,10:S=S+1:ND=ND+1:POSITION 5,0:? #6;S:IF L/2<>INT(L/2) AND ND>105 THEN 650
612 IF L/2=INT(L/2) AND ND>160 THEN 650
619 SOUND 0,0,0,0:RETURN 
620 S=S+20:POSITION 5,0:? #6;S:FOR WW=1 TO 7:FOR W=0 TO 50 STEP 10:SOUND 0,W,10,14
622 IF WW=1 OR WW=3 OR WW=5 OR WW=7 THEN COLOR 234:PLOT H,V
623 IF WW=2 OR WW=4 OR WW=6 THEN COLOR 112:PLOT H,V
629 NEXT W:NEXT WW:SOUND 0,0,0,0:RETURN 
650 LOCATE X,Y+1,Z:IF Z=235 THEN Y=Y+1:GOTO 660
652 LOCATE X,Y-1,Z:IF Z=235 THEN Y=Y-1:GOTO 660
654 IF X<19 THEN LOCATE X+1,Y,Z:IF Z=235 THEN X=X+1:GOTO 660
655 IF X>0 THEN LOCATE X-1,Y,Z:IF Z=235 THEN X=X-1:GOTO 660
657 LOCATE 0,6,Z:IF Z=235 THEN X=0:Y=6:GOTO 660
658 LOCATE 19,6,Z:IF Z=235 THEN X=19:Y=6
660 COLOR 234:PLOT X,Y:FOR W=190 TO 0 STEP -5:SOUND 0,W,10,10:SOUND 1,W+1,10,10:IF W/10=INT(W/10) THEN POKE 712,184
662 IF (W-5)/10=INT((W-5)/10) THEN POKE 712,0
664 NEXT W:S=S+100:POSITION 5,0:? #6;S
699 SOUND 0,0,0,0:SOUND 1,0,0,0:POKE 712,0:GOTO 500
900 COLOR 72:PLOT 0,1:DRAWTO 19,1:DRAWTO 19,11:DRAWTO 0,11:DRAWTO 0,1:PLOT 4,2:PLOT 4,3:PLOT 4,10:PLOT 4,9
901 PLOT 2,3:DRAWTO 2,5:DRAWTO 4,5:PLOT 2,9:DRAWTO 2,7:DRAWTO 4,7:PLOT 8,3:PLOT 9,3:PLOT 8,9:PLOT 9,9:PLOT 6,3
902 DRAWTO 6,5:DRAWTO 8,5:PLOT 6,9:DRAWTO 6,7:DRAWTO 8,7:PLOT 11,3:PLOT 12,3:PLOT 12,4:PLOT 11,9:PLOT 12,9
903 PLOT 12,8:PLOT 10,5:PLOT 10,7:PLOT 10,6:DRAWTO 12,6:PLOT 17,3:DRAWTO 14,3:DRAWTO 14,5:PLOT 14,7:DRAWTO 14,9
904 DRAWTO 17,9:PLOT 16,5:DRAWTO 18,5:PLOT 16,7:DRAWTO 18,7
910 COLOR 235:FOR X=1 TO 18:FOR Y=2 TO 10:LOCATE X,Y,Z:IF Z=32 OR Z>72 THEN PLOT X,Y
911 NEXT Y:NEXT X:PLOT 19,6:PLOT 0,6:COLOR 234:PLOT 18,6
919 RETURN 
920 COLOR 235:FOR X=1 TO 18:FOR Y=2 TO 10:PLOT X,Y:NEXT Y:NEXT X:COLOR 72:PLOT 0,6:PLOT 19,6
999 RETURN 
1000 DATA 255,129,129,129,129,129,129,255
1001 DATA 60,126,219,255,195,189,255,170
1002 DATA 60,126,219,255,153,195,102,60
1003 DATA 0,0,0,24,24,0,0,0
1004 DATA 145,82,20,120,27,156,42,65
1009 DATA 8,12,14,56,124,254,254,124

Credits