Skull Chase
- Type
- Game
- Category
- Chase game
- Author
- Dave Miller
- Published in
- The Best of Antic, Volume 1 (Antic Publishing), "Bonus Games"
- Year
- 1983
- Language
- Atari BASIC
- Requirements
- 16K RAM, joystick in port 1, Atari BASIC
- Related
- Drop, Crystal Caves, Diver, Fallout, Risky Rescue, Starsector Defense
About the program
Skull Chase appeared among the "Bonus Games" in The Best of Antic, Volume 1. The REM in line 20 dates it to April 1983. The book presented it as a demonstration of table lookup, a way of getting speed out of BASIC, and it is a tidy example of the technique.
You steer a little race car around a walled field with the joystick. A skull bounces about at random, and your job is to run into it. Each catch scores points. The action freezes for a moment and a tree is planted somewhere on the field. Then the chase starts again, with one more obstacle. There are two kinds of tree. Touching a pine costs you points. Touching an oak wrecks your car and ends the round. Your score and the session's high score are then shown, and the fire button starts a new game.
What you need
A joystick in port 1, 16K and Atari BASIC. There is no machine code.
Typing it in
The only special characters are in the title string in line 100 and the score screen in line 570. {inv}…{/inv} marks inverse-video letters (press the Atari key before and after), which come out in a different colour in GRAPHICS 17. Lines 850–1020 redefine the characters. Each DATA line starts with an ATASCII code and is followed by the eight bytes of its shape.
How to play
Push the joystick in any of eight directions. The car turns to face the way it is going. Each skull caught is worth 50 points plus a bonus that grows by 25 with every catch. That same growing amount is taken away when you brush a pine, so later mistakes cost more.
How it works
- Three arrays indexed by the joystick value replace all the IF tests.
DX(ST)andDY(ST)give the step for each of the eight directions, andCHR(ST)gives the car character that faces that way (lines 120–140). Line 220 then moves the car without a single comparison. - The screen is GRAPHICS 17 (GRAPHICS 1 without a text window), and everything is drawn by POKEing character codes into screen memory at
PEEK(88)+256*PEEK(89), 20 bytes per row. - Collisions need no hardware registers: before a move,
PEEK(KPOS)reads the character in the target cell, so the program knows whether it is about to hit the skull (83), an oak (9), a pine (10) or a wall. - The skull keeps its own
DX/DYand picks a new direction at random when its next cell is not empty. - Lines 610–650 store the custom characters 2K below the top of memory. Line 620 skips the work if a previous run already left the font there.
Changes from the published listing
One change, so the program also runs under Altirra BASIC, the free replacement BASIC built into many emulators. Altirra BASIC adds a command called CP, so it rejected the published lines that use that word as the start of a variable name. The variable is renamed everywhere in the program. The new name is the same length, so the memory layout is unchanged and the program behaves exactly as published on genuine Atari BASIC. If you type it in from the magazine, the original names work fine on a real Atari.
| Published | Now | Lines |
|---|---|---|
CPOS |
KPOS |
230, 240, 250, 260, 280, 300 |
Listing
10 REM ******** SKULL CHASE ********
20 REM BY DAVE MILLER APRIL 1983
100 GRAPHICS 17:DIM TITLE$(12):TITLE$="s{inv}k{/inv}u{inv}l{/inv}l {inv}C{/inv}H{inv}A{/inv}S{inv}E{/inv}":POSITION 4,8:FOR X=1 TO 12
101 ? #6;TITLE$(X,X);:SOUND 0,20-(X*1.5),8,14:FOR W=1 TO 250:NEXT W:NEXT X:SOUND 0,0,0,0
110 DIM CHR(15),DX(15),DY(15):SCORE=0:HISCORE=0:XTRA=0
120 DX(14)=0:DX(13)=0:DX(9)=-1:DX(10)=-1:DX(11)=-1:DX(5)=1:DX(6)=1:DX(7)=1
130 DY(11)=0:DY(7)=0:DY(6)=-1:DY(10)=-1:DY(14)=-1:DY(5)=1:DY(9)=1:DY(13)=1
140 CHR(14)=92:CHR(13)=93:CHR(11)=94:CHR(7)=95:CHR(10)=81:CHR(6)=69:CHR(9)=90:CHR(5)=67:SKULL=147-64:GOSUB 610
150 ? #6;"{CLEAR}":POKE 708,196:POKE 709,22:POKE 710,52:POKE 711,8
160 POKE 756,CHSET/256:SCREEN=PEEK(88)+256*PEEK(89):GOSUB 660
170 PX=10:PY=11:POKE SCREEN+PX+20*PY,CHR(14):DX=1:DY=1
180 BX=INT(16*RND(1)+3):BY=INT(20*RND(1)+3)
190 REM ******* MAIN LOOP **********
200 ST=STICK(0):IF ST=15 THEN SOUND 2,0,0,0:GOTO 310
210 SOUND 2,90,6,2
220 TX=PX+DX(ST):TY=PY+DY(ST)
230 KPOS=SCREEN+TX+20*TY
240 IF PEEK(KPOS)=SKULL THEN 420
250 IF PEEK(KPOS)=9 THEN 490
260 IF PEEK(KPOS)=10 THEN SCORE=SCORE-XTRA:FOR W=1 TO 20:SOUND 3,100,10,14:POKE 712,58:NEXT W
270 SOUND 3,0,0,0:POKE 712,0
280 IF PEEK(KPOS) THEN 310
290 CHR=CHR(ST)
300 POKE SCREEN+PX+20*PY,0:POKE KPOS,CHR:PX=TX:PY=TY
310 TEMPBX=BX+DX:TEMPBY=BY+DY
320 SPOS=SCREEN+TEMPBX+20*TEMPBY
330 IF NOT PEEK(SPOS) THEN 380
340 SOUND 2,100,10,14:SOUND 2,0,0,0
350 IF RND(1)>0.5 THEN DX=-DX:GOTO 200
360 IF RND(1)>0.5 THEN DY=-DY:GOTO 200
370 DX=-DX:DY=-DY:GOTO 200
380 POKE SCREEN+BX+20*BY,0:POKE SPOS,SKULL
390 BX=TEMPBX:BY=TEMPBY
400 GOTO 200
410 REM ******* SUCCESS ********
420 SCORE=SCORE+50+XTRA:XTRA=XTRA+25:POKE 77,0
430 FOR T=40 TO 10 STEP -10:SOUND 2,7,10,12:SOUND 2,0,0,0:FOR I=1 TO 15:NEXT I:NEXT T
440 A=PEEK(709):FOR I=255 TO 0 STEP -5:POKE 709,I:NEXT I:POKE 709,A
450 S=INT(RND(0)*2)+9
460 R=SCREEN+INT(480*RND(0)):IF PEEK(R) OR PEEK(R)=SKULL THEN GOTO 460
470 POKE R,S:POKE SCREEN+BX+20*BY,0:POKE SCREEN+PX+20*PY,0:GOTO 170
480 REM ******** FAILURE ********
490 SOUND 2,0,0,0
500 FOR I=100 TO 200 STEP 2
510 POKE SCREEN+PX+20*PY,INT(RND(0)*4)+76:POKE 709,PEEK(53770)
520 SOUND 0,I,6,15-INT((I-100)/7)
530 NEXT I
540 POKE SCREEN+PX+20*PY,0
550 FOR I=150 TO 1 STEP -1:POKE 711,I:POKE 709,I+16:POKE 708,I+32:POKE 710,I+64:SOUND 0,I+50,10,8:NEXT I
560 SOUND 0,0,0,0:IF SCORE>=HISCORE THEN HISCORE=SCORE
570 GRAPHICS 1+16:POSITION 0,5:? #6;"your SCORE WAS ";SCORE:POSITION 0,8:? #6;"{inv}HIGH{/inv} SCORE IS ";HISCORE
580 POSITION 5,19:? #6;"{inv}press fire{/inv}":IF STRIG(0)=1 THEN 580
590 SCORE=0:GOTO 150
600 REM *** READ DATA FOR CHSET *****
610 CHSET=(PEEK(106)-8)*256
620 RESTORE 850:IF PEEK(CHSET+9*8)=56 THEN RETURN
630 READ A:A=A-64:IF A<0 THEN RETURN
640 FOR J=0 TO 7:READ B:POKE CHSET+A*8+J,B:POKE 708+3*RND(0),PEEK(53770):NEXT J
650 GOTO 630
655 REM ****** CREATE BRICK WALL*****
660 WALL=210:BWALL=188
670 FOR W=0 TO 5:P=INT(RND(0)*470)
680 FOR I=0 TO 4
690 POKE SCREEN+P+I,BWALL
700 NEXT I:NEXT W
710 FOR W=0 TO 5:P=INT(RND(0)*470)
720 FOR I=0 TO 4
730 POKE SCREEN+P+I*20,BWALL
740 NEXT I:NEXT W
750 REM ******* CREATE BORDER *******
760 FOR I=0 TO 19
770 POKE SCREEN+I,WALL
780 POKE SCREEN+460+I,WALL
790 NEXT I
800 FOR I=0 TO 23
810 POKE SCREEN+I*20,WALL
820 POKE SCREEN+19+I*20,WALL
830 NEXT I:RETURN
840 REM ***** DATA FOR CHSET ********
850 DATA 67,24,28,48,250,223,77,24,12
860 DATA 69,12,24,77,223,250,48,28,24
870 DATA 73,56,254,127,62,8,8,8,255
880 DATA 74,8,28,62,127,62,8,8,8
890 DATA 75,0,32,0,16,8,16,4,0
900 DATA 76,0,64,0,16,68,16,4,0
910 DATA 77,0,64,16,2,0,128,32,2
920 DATA 78,128,8,1,0,0,0,0,64
930 DATA 79,8,0,0,0,0,0,0,0
940 DATA 81,48,24,178,251,95,12,56,24
950 DATA 82,219,153,24,231,231,24,153,219
960 DATA 83,189,126,90,126,60,36,90,129
970 DATA 90,24,56,12,95,251,178,24,48
980 DATA 92,102,126,102,24,24,219,255,195
990 DATA 93,195,255,219,24,24,102,126,102
1000 DATA 94,15,239,226,94,94,226,239,15
1010 DATA 95,240,247,71,122,122,71,247,240
1020 DATA 124,255,145,145,255,255,137,137,255
1030 DATA -1
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: SKULL.BAS.
Credits
- Program listing: Skull Chase — program listing (The Best of Antic, Volume 1 (Antic Publishing), "Bonus Games") — Dave Miller
- Picture: Skull Chase at the start of a round: the car (centre) and the skull (top right) among randomly placed brick walls. — Dave Miller (program); screenshot by the site
- Antic article text (Best of Antic Book) — Skull Chase — Dave Miller
- Antic Software Archive — disk files (Best of Antic Book): SKULL.BAS — AtariMagazines.com (Kevin Savetz)
