0 REM PONGTC 4/11/85 R. Perry 1 ' 2 '*** Compile with TCOMP, Start Address <= 60500 *** 3 ' 10 'In reply to the "Ready ?" prompt, press ENTER to continue. 11 'You control the paddle using the following keys: 12 ' KEY PADDLE RESPONSE 13 '----- --------------- 14 ' ESC far left 15 'SPACE middle 16 ' BKSP far right 17 ' 1 between middle and far left 18 ' = between middle and far right 19 ' 2 incremental move left 20 ' - incremental move right 21 'Each time you successfully hit the ball with the paddle 22 'the top wall moves down by one line and you receive a number 23 'of points proportional to the size of the top wall. 24 'If you are able to continue until the top wall reaches 25 'the bottom, you get bonus points. 26 'Players 1 and 2 alternate. You need 10,000 points to win. 27 'Use Function Key F8 to quit. 100 DEFINTA-Z 105 CALL16954'Label line off 110 CLS:POKE64173,0'disable Label key 115 CALL16974'cursor off 120 PRINT@80,"Speed: 1 (slow) ... 9 (fast) : "; 125 GOSUB685:B=N:IFB=0THEN125 130 IFB<49THEN125 135 IFB>57THEN125 140 PRINTCHR$(B);:B=59-B:B=B*18 145 F=0:G=0:P=2:M=0:M=M-1 150 IFP=1THEN170 155 IFF>9999THEN550 160 IFG>9999THEN550 165 P=1:GOTO175 170 P=2 175 PRINT@240," Player #";:PRINTP;:PRINT" Ready ? "; 180 POKE65450,0'purge keyboard buffer 185 GOSUB685:IFN=13THEN195 190 GOTO185 195 CLS:K=M:D=19:W=1:S=59:T=D:U=S:V=60:Q=1:GOSUB630:S=177:U=S:GOSUB630 200 S=59:T=0:U=177:V=T 205 GOSUB630:T=T+1:V=T:IFT>DTHEN215 210 GOTO205 215 PRINT@41,"PLAYER";:PRINT@83,"#1";:PRINT@71,"PLAYER";:PRINT@113,"#2"; 220 PRINT@161,F;:PRINT@191,G; 225 Z=114:S=Z:T=60:U=Z+8:V=T:GOSUB630:CALL21274'delay 1/2 sec 230 X=PEEK(63791):X=XMOD115:X=60+X:Y=D+3:GOSUB590:S=X:T=Y:U=S+2:V=T:A=0 235 GOSUB630:T=T-1:V=T:A=A+1:IFA<3THEN235 240 'main Pong loop 245 E=0:C=0:GOSUB370:IFW=0THEN150 250 E=E+1:GOSUB685 255 N=PEEK(65430):IFN=4THEN300'- 260 IFN=8THEN335'= 265 N=PEEK(65429):IFN=2THEN310'2 270 IFN=1THEN340'1 275 N=PEEK(65431):IFN=2THEN320'BS 280 IFN=8THEN325'ESC 285 IFN=1THEN330'SP 290 IFE>BTHEN245 295 GOTO250'delay 300 IFZ>167THEN290 305 L=3:GOTO345 310 IFZ<63THEN290 315 L=M-2:GOTO345 320 L=168-Z:GOTO345 325 L=60-Z:GOTO345 330 L=114-Z:GOTO345 335 L=141-Z:GOTO345 340 L=87-Z 345 IFC=1THEN290 350 'move paddle 355 C=1:S=Z:T=60:U=Z+8:V=T:Q=0:GOSUB630:Z=Z+L:S=Z:U=Z+8:Q=1:GOSUB630 360 GOTO290 365 'move ball 370 IFY=59THEN380 375 GOTO400 380 A=Z+8:IFX>ATHEN395 385 A=Z-2:IFXGTHEN570 560 PRINT@241,"Player #2 wins!";:GOTO575 565 PRINT@241,"Tie game!";:GOTO575 570 PRINT@241,"Player #1 wins!"; 575 BEEP:BEEP:BEEP:CALL21264:BEEP:BEEP:BEEP:CALL21264:BEEP:BEEP:BEEP:CALL21264 580 POKE65450,0:MENU 585 'random horizontal bounce 590 H=PEEK(63791):H=HMOD7 595 IFH=3THEN610 600 IFH>3THEN615 605 H=M:RETURN 610 H=0:RETURN 615 H=1:RETURN 620 'line(s,t)-(u,v),q with either (s=u and v>t) or (t=v and u>s), 625 'i.e. draws horizontal or vertical lines 630 I=S:J=T 635 IFQ=0THEN645 640 PSET(I,J):GOTO650 645 PRESET(I,J) 650 IFS=UTHEN665 655 I=I+1:IFI>UTHEN675 660 GOTO635 665 J=J+1:IFJ>VTHEN675 670 GOTO635 675 RETURN 680 'inkey 685 N=PEEK(65432):IFN=128THEN580'F8 690 N=PEEK(65433):IFN>127THEN580'Break 695 N=0:N$=INKEY$:IFN$<>""THENN=ASC(N$) 700 RETURN