Compucolor.org – Virtual Media

Listing of file='PONG.BAS;01' on disk='vmedia/games-sector.ccvf'

100 REM 	PONG BY C TEO SEP 82
110 IF PEEK (40877)* PEEK (40878)< > 29889THEN PLOT 27,4:PRINT "LOA GAMER3.PRG":PLOT 27,27
120 OUT 8,255:POKE 33283,173:POKE 33284,159
130 POKE 32940,172:POKE 32941,159
140 CLEAR 50:CC= - 1:D1= 1:D2= 2:GOTO 490
150 PLOT 12:D(1)= - 1:D(2)= 1
160 Y= RND (- PEEK (33209))
170 OUT 8,199:PLOT 27,24:S= 1:P1= 0:P2= 0:Y1= 16:Y2= 16:BX= 2:BY= 17:DX= 2:DY= 1
180 PLOT 3,2,0:PRINT "````````````````````````````````````````````````````````````"
190 PLOT 3,2,31:PRINT "````````````````````````````````````````````````````````````"
200 PLOT 27,10:IF CCTHEN 400
210 S= 1:PLOT 27,10
220 X= CALL (1):IF X= 0GOTO 240
230 D1= D(X):IF Y1+ D1> 1AND Y1+ D1< 27THEN Y1= Y1+ D1
240 X= CALL (2):IF X= 0GOTO 260
250 D2= D(X):IF Y2+ D2> 1AND Y2+ D2< 27THEN Y2= Y2+ D2
260 IF I= 8THEN S= 1.5
270 IF I= 20THEN S= 2
280 IF D1THEN PLOT 3,1,Y1- 1:PRINT " ```` "
290 IF D2THEN PLOT 3,62,Y2- 1:PRINT " ```` "
310 REM   MOVE  BALL
320 BX= BX+ DX:IF BX> 62OR BX< 1THEN 440
330 BY= BY+ DY:IF BY> 30OR BY< 1THEN DY= - DY:BY= BY+ 2* DY:X= CALL (- 1)
340 IF CCTHEN GOSUB 460:GOTO 370
350 PLOT 3,127,LX,LY,3,32,3,127,BX,BY,2,100
360 LX= BX:LY= BY
370 IF INT (BX)= 62THEN X= CALL (- 1):IF ABS (BY- Y2- 2)< 2.1THEN 580
380 IF INT (BX)= 1THEN X= CALL (- 1):IF ABS (BY- Y1- 2)< 2.1THEN 630
390 IF NOT (CC)THEN 220
400 Y2= BY- 2:Y1= BY- 2
410 IF  Y2< 1 THEN  Y2= 1:Y1= 1
420 IF  Y2> 27 THEN  Y2= 27:Y1= 27
430 GOTO 260
440 PLOT 27,24,3,21,2:IF BX> 62THEN PRINT "POINT TO LEFT  PLAYER":GOTO 590
450 PRINT "POINT TO RIGHT PLAYER":GOTO 640
460 POKE PO,LC:PO= 28672+ 128* BY+ BX+ BX:LC= PEEK (PO):POKE PO,100
470 X= CALL (1):IF X< > 0THEN CC= 0:GOTO 150
480 RETURN
490 PLOT 12,3,15,5
500 PRINT "THE FIRST TO REACH ELEVEN SCORE WINS."
510 PLOT 3,24,7:PRINT "PRESS  W  TO START."
530 PLOT 3,22,11:PRINT "PLAYER  1     PLAYER  2"
550 PLOT 3,23,15:PRINT "UP  -  W      UP  -  P
560 PLOT 3,22,17:PRINT "DOWN -  Z     DOWN -  ."
570 GOTO 170
580 I= I+ 1:BX= 61:DX= - 2* S:DY= (BY- Y2- 2):GOTO 220
590 P1= P1+ 1:GOSUB 680
600 BX= 2:BY= Y1+ 2:DX= 2:DY= RND (1)* 2- 1:I= 0
610 GOSUB 750
620 GOTO 210
630 I= I+ 1:BX= 2:DX= 2* S:DY= (BY- Y1- 2):GOTO 220
640 P2= P2+ 1:GOSUB 680
650 BX= 61:BY= Y2+ 2:DX= - 2:DY= RND (1)* 2- 1:I= 0
660 GOSUB 750
670 GOTO 210
680 PLOT 27,24,3,20,1:PRINT "SCORE LEFT ";P1;"  RIGHT ";P2
690 IF P1> 10THEN PLOT 3,20,2:PRINT " LEFT PLAYER WINS":GOTO 720
700 IF P2> 10THEN PLOT 3,20,2:PRINT " RIGHT PLAYER WINS":GOTO 720
710 GOSUB 750:RETURN
720 OUT  8,255:PLOT 3,20,3:INPUT "PLAY AGAIN ?";A$
730 IF LEFT$ (A$,1)= "Y"THEN GOTO 150
740 END
750 FOR II= 1TO 999:NEXT :RETURN