Collision

David Bohike

Now is the time for iron nerves and instant reflexes. Your nimble sports car will soon by flying down the dreadful ribbon pavement known as the "Serpent of Oblivion." There's no chance of turning around or slowing down -- you must forge ahead until the inevitable collision. But you will succeed if you can survive longer and score more points than any of your opponents.

To begin your challenge of the Serpent, plug a joystick into Slot #1. One to four players can compete in each game. Every player will have three turns to navigate the swooning roadway. Before play starts, you must also select a skill level (1-5). This will determine the width of the track.

During play, your car will be at the top of the screen. The curving road will move from the bottom of the screen to the top. To avoid a collision, you must maneuver your car to remain on the roadway while also avoiding any obstructions on the road. Steering your car is a matter of pushing the joystick to the left or right. The 'wheel' is very sensitive, so it may take some practice to get the feel of the car. The longer you push the stick (left or right) the faster your car will veer in that direction.

Scoring is determined by the skill level selected and the length of time you survive before the certain collision. At the end of each player's turn, a score card showing each drivers' score for every turn will be displayed. The higher your score, the better your driving ability on the Serpent. At this time, the player who is to drive next will be prompted to press the fire button which will initiate your turn.

The program listing for collision should be fairly easy to decipher. Lines 5-30 are the initialization. N$ will hold the players' names, S(4,3) contains each player's score for each round, and R$(20) holds the graphics string for the roadway. Lines 50-172 are the prompts for the beginning of the game options.

The main game loop is in lines 180-410. Your car is displayed using Player/Missile graphics. The car position is printed in line 370; and a collision is checked for in line 380. Line 320 prints the road obstacles and adjusts a counter to increase their frequency as your turn progresses.

In the subroutine at 500-550, the sounds and colors are changed after a collision. The subroutine at 600-699 displays the score card. Lines 900-960 set up the Player/Missile graphics and the routine at 970 formats the string to print the roadway.

David Bohike, Lynn Drive, Coggon, IA 52218.

5 REM COLLISION  by David Bohlke
10 GRAPHICS 0:POKE 752,1
15 DIM B$(6),N$(32),N(4),S(4,3),R$(20)
18 FOR I=0 TO 4:FOR J=0 TO 3:S(I,J)=0:NEXT J:NEXT I
20 SETCOLOR 2,13,4:SETCOLOR 4,4,2
30 H=120:GOSUB 900:LD=1
40 PRINT "}":POSITION 13,3:PRINT " COLLISION "
50 POSITION 3,6:PRINT "How many players (1-4) ";:INPUT NP:IF NP<1 OR NP>4 THEN 40
55 FOR I=1 TO NP:PRINT :PRINT "ENTER name of player # ";I;"  ";
60 INPUT B$:N(I)=LEN(B$)+N(I-1):N$(N(I-1)+1,N(I))=B$:NEXT I
100 PRINT "}":POSITION 13,3:PRINT " COLLISION "
110 POSITION 2,10:PRINT "PUSH STICK to enter SKILL LEVEL,":PRINT "then press the FIRE button . . ."
120 POSITION 2,16:PRINT " 1  is easiest,  5  is hardest ?"
150 POSITION 35,16:PRINT LD;
152 FOR I=1 TO 50:NEXT I
155 IF STRIG(0)=0 THEN 172
160 IF STICK(0)=15 THEN 150
165 LD=LD+1:IF LD=6 THEN LD=1
170 GOTO 150
172 L=13-LD:GOSUB 970
174 PRINT :PRINT :PRINT N$(1,N(1));" --- press FIRE for your turn ?";
175 FOR I=1 TO 333:NEXT I
176 IF STRIG(0)=1 THEN 176
180 FOR RD=1 TO 3:FOR PL=1 TO NP
190 C1=15:PRINT "}"
200 A=12:B=0.5:C=0:P=0:K=0
210 POKE 77,0:S=0
220 POKE 53278,0
250 FOR I=0 TO 23:POSITION 12,I:PRINT R$:NEXT I
300 POSITION A,23:PRINT R$
305 SOUND 0,100-ABS(S)*10,4,ABS(S)*2+2
310 A=A+B:IF A>22 OR A<1 OR RND(0)<0.01 THEN B=-B
320 C=C+1:IF C=C1 THEN POSITION A+RND(0)*(L-3)+3,22:PRINT "    ";:C=0:P=P+LD*2:IF INT(P/100)>K THEN K=K+1:C1=C1-1
340 P=P+1:POSITION 1,0:PRINT P;
350 IF STICK(0)<8 THEN S=S+1:GOTO 370
360 IF STICK(0)<12 THEN S=S-1
370 H=H+S:POKE 53248,H
380 IF PEEK(53252)<>0 THEN GOSUB 500:GOTO 400
390 GOTO 300
400 S(PL,RD)=P:GOSUB 600
405 NEXT PL
410 NEXT RD
420 END
500 SOUND 0,0,0,0
510 FOR I=1 TO 5:SETCOLOR 4,RND(0)*16,RND(0)*16:SETCOLOR 2,RND(0)*16,RND(0)*16
520 FOR J=1 TO 5:SOUND 0,RND(0)*30,4,8:SOUND 1,RND(0)*I*10,8,8:NEXT J
522 NEXT I:SOUND 0,0,0,0:SOUND 1,0,0,0
540 H=120:POKE 53248,H
550 RETURN
600 PRINT "}":POSITION 3,1:PRINT " COLLISION "
605 SETCOLOR 2,1,2:SETCOLOR 4,11,4
610 POSITION 3,4:PRINT "Round:   One    Two    Three   TOTAL"
620 FOR I=1 TO NP:POSITION 1,I*4+3:PRINT N$(N(I-1)+1,N(I));
622 FOR J=0 TO 39:POSITION J,I*4+5:PRINT " ";:NEXT J:NEXT I
630 FOR I=1 TO NP:T=0
635 FOR J=1 TO RD:T=T+S(I,J)
640 POSITION J*7+5,I*4+3:PRINT S(I,J);:POSITION 34,I*4+3:PRINT T;:NEXT J:NEXT I
680 P=PL+1:IF P>NP THEN P=1:IF RD=3 THEN 697
690 POSITION 1,23:PRINT N$(N(P-1)+1,N(P));" --- Press FIRE for your turn ?";
692 IF STRIG(0)=1 THEN 690
693 SETCOLOR 2,13,4:SETCOLOR 4,4,2
695 RETURN
697 POSITION 1,23:PRINT "Press FIRE for next game ??????";
698 IF STRIG(0)=1 THEN 697
699 RUN
900 MB=PEEK(106)-8:POKE 54279,MB:PB=256*MB
910 POKE 559,46:POKE 53277,3
920 FOR I=PB+512 TO PB+640:POKE I,0:NEXT I
930 POKE 53248,H:POKE 704,122:POKE 53256,0
940 FOR I=PB+530 TO PB+536:READ A:POKE I,A:NEXT I
950 DATA 51,63,30,12,12,63,51
960 RETURN
970 R$="|"
972 FOR I=1 TO L:R$(LEN(R$)+1)=" ":NEXT I
974 R$(LEN(R$)+1)="|":RETURN

Table of Contents
Previous Section: Scurry
Next Section: Air Defense