Guest User

Untitled

a guest
Nov 30th, 2020
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.27 KB | None | 0 0
  1. 10 REM BAT N BALL
  2. 20 REM Byteback Issue Two
  3. 30 REM September 1993
  4. 40 *FX200,3
  5. 45 ON ERROR RUN
  6. 50 computer%=FALSE
  7. 60 MODE7:PROCrules
  8. 70 REPEAT
  9. 80 PROCsetup
  10. 90 *TV255
  11. 100 MODE4:PROCscreen
  12. 110 VDU23;8202;0;0;0;
  13. 120 PROCserve:*FX200,2
  14. 130 REPEAT
  15. 140 PROCball
  16. 150 IF hits%<5 delay%=50
  17. 160 IF hits%>5 AND hits%<10 delay%=20
  18. 170 IF hits%>10 AND hits%<15 delay%=5
  19. 180 IF hits%>15 delay%=1
  20. 190 FOR L=1 TO delay%:NEXT
  21. 200 PROCleft_bat
  22. 210 IF computer% PROCcomputer ELSE PROCright_bat
  23. 220 IF INKEY(-83) colour%=colour%+1:IF colour%>7 colour%=1
  24. 230 IF INKEY(-83) VDU19,1,colour%,0,0,0
  25. 240 UNTIL game_over%=TRUE
  26. 250 PROCgame_over
  27. 260 UNTIL The_Second_Coming
  28. 270 :
  29. 280 DEFPROCleft_bat
  30. 290 IF NOT(INKEY(-17)OR INKEY(-98)) ENDPROC
  31. 300 IF INKEY(-17) AND l%>3 PRINTTAB(1,l%)nobat$:l%=l%-1:PRINTTAB(1,l%)bat$
  32. 310 IF INKEY(-98)AND l%<26 PRINTTAB(1,l%)nobat$:l%=l%+1:PRINTTAB(1,l%)bat$
  33. 320 ENDPROC
  34. 330 :
  35. 340 DEFPROCright_bat
  36. 350 IF NOT(INKEY(-57)OR INKEY(-105))ENDPROC
  37. 360 IF INKEY(-57)AND r%>3 PRINTTAB(37,r%)nobat$:r%=r%-1:PRINTTAB(37,r%)bat$
  38. 370 IF INKEY(-105)AND r%<26 PRINTTAB(37,r%)nobat$:r%=r%+1:PRINTTAB(37,r%)bat$
  39. 380 ENDPROC
  40. 390 :
  41. 400 DEFPROCball
  42. 410 IF y%+yd%>28 OR y%+yd%<3 yd%=-yd%:SOUND2,-15,100,1
  43. 420 PRINTTAB(x%,y%)CHR$(32):x%=x%+xd%:y%=y%+yd%:PRINTTAB(x%,y%)ball$
  44. 430 IF (x%+xd%)>36 PROCcheck_right
  45. 440 IF (x%+xd%)<2 PROCcheck_left
  46. 450 ENDPROC
  47. 460 :
  48. 470 DEFPROCgame_over
  49. 480 *FX21,0
  50. 490 SOUND1,-15,136,1:SOUND1,0,0,1:SOUND1,-15,136,1
  51. 500 PRINTTAB(9,8)"Another Game (Y/N)?";
  52. 510 G$=GET$:IF G$<>"Y" AND G$<>"y"CLS:PRINT"Don't Forget To Subscribe to ByteBack!":A=GET:CALL!-4
  53. 520 computer%=0:RUN
  54. 530 game_over%=FALSE
  55. 540 ENDPROC
  56. 550 :
  57. 560 DEFPROCcheck_left
  58. 570 IF y%=1OR y%=(l%+1)OR y%=(l%+2) SOUND1,-15,200,1:xd%=-xd%:hits%=hits%+1:ENDPROC
  59. 580 FORS%=50 TO 10STEP-10:SOUND1,-15,S%,1:NEXT:score_right%=score_right%+1 :PRINTTAB(33,0);score_right%
  60. 590 PRINTTAB(x%,y%)CHR$32
  61. 600 FORloop%=1TO4:PRINTTAB(0,y%)ball$:FORloop2%=1TO1500:NEXT:PRINTTAB(0,y%)CHR$32:FORloop2%=1TO1500:NEXT:NEXT
  62. 610 IF score_right%>4PROCright_wins:ENDPROC
  63. 620 hits%=0
  64. 630 PROCserve
  65. 640 ENDPROC
  66. 650 :
  67. 660 DEFPROCcheck_right
  68. 670 IF y%=r%OR y%=(r%+1)OR y%=(r%+2)SOUND1,-15,200,1:xd%=-xd%:hits%=hits%+1:ENDPROC
  69. 680 FORS%=50TO10 STEP-10:SOUND1,-15,S%,1:NEXT:score_left%=score_left%+1:PRINTTAB(5,0);score_left%
  70. 690 PRINTTAB(x%,y%)CHR$32
  71. 700 FOR loop1%=1TO4:PRINTTAB(39,y%)ball$:FOR loop2%=1TO1500:NEXT:PRINTTAB(39,y%)CHR$32:FOR loop2%=1TO1500:NEXT:NEXT
  72. 710 IFscore_left%>4 PROCleft_wins:ENDPROC
  73. 720 hits%=0
  74. 730 PROCserve
  75. 740 ENDPROC
  76. 750 :
  77. 760 DEFPROCcomputer
  78. 770 IF RND(100)>99 ENDPROC
  79. 780 IF (xd%<0 AND RND(100)>25) ENDPROC
  80. 790 IF r%<y% AND r%<26 PRINTTAB(37,r%)nobat$:r%=r%+1:PRINTTAB(37,r%)bat$
  81. 800 IF (r%+1)>y% AND r%>3 PRINTTAB(37,r%)nobat$:r%=r%-1:PRINTTAB(37,r%)bat$
  82. 810 ENDPROC
  83. 820 :
  84. 830 DEFPROCserve
  85. 840 FOR loop%=1TO1000:NEXT:hits%=0
  86. 850 PRINTTAB(1,l%)nobat$;TAB(37,r%)nobat$
  87. 860 x%=17+RND(5):y%=10+RND(5):l%=15:r%=15:xd%=1:yd%=1:IF RND(4)>1 xd%=-1
  88. 870 IF RND(4)>1 yd%=-yd%
  89. 880 PRINTTAB(1,l%)bat$;TAB(37,r%)bat$
  90. 890 PRINTTAB(15,6)"READY ?"
  91. 900 FOR loop%=1 TO 8000:NEXT
  92. 910 PRINTTAB(15,6)" "
  93. 920 ENDPROC
  94. 930 :
  95. 940 DEFPROCleft_wins
  96. 950 game_over%=TRUE
  97. 960 PRINTTAB(10,6) "Player One Wins!"
  98. 970 ENDPROC
  99. 980 :
  100. 990 DEFPROCright_wins
  101. 1000 game_over%=TRUE
  102. 1010 IF computer% PRINTTAB(14,6)"I win!" ELSE PRINTTAB(10,6) "Player Two Wins!"
  103. 1020 ENDPROC
  104. 1030 :
  105. 1040 DEFPROCone_or_two_players
  106. 1050 PRINT'"1 or 2 Players (1/2) ?";
  107. 1060 G$=GET$:IFG$<>"1"AND G$<>"2"GOTO1060
  108. 1070 IF G$="1" computer%=TRUE
  109. 1080 ENDPROC
  110. 1090 :
  111. 1100 DEFPROCscreen
  112. 1110 PRINTTAB(0,3)edge$;TAB(0,30)edge$
  113. 1120 PRINTTAB(5,1);score_left%;TAB(33,1);score_right%
  114. 1130 PRINTTAB(0,31)"BAT 'N' BALL - ByteBack Issue Two"
  115. 1140 PRINTTAB(1,l%)bat$;TAB(37,r%)bat$
  116. 1150 ENDPROC
  117. 1160 :
  118. 1170 DEFPROCrules
  119. 1180 PRINTCHR$141;CHR$131;" BAT and BALL - 1993"'CHR$141;CHR$131;" BAT and BALL - 1993"
  120. 1190 PRINT'"Based on the classic bat and ball game of the '70's, your task is to keep the 'ball' in play by defending your 'goal' at either edge of the screen."
  121. 1200 PRINT'"The game starts off easy but WATCH OUT! After 5 hits the game speeds up."
  122. 1210 PRINT'"The first person to reach a score of 5 wins the game."
  123. 1220 PRINT'"The control keys are as follows:"
  124. 1230 PRINT"Q LEFT ["
  125. 1240 PRINT"Z RIGHT /"
  126. 1250 PRINT'"C changes the screen colour when in play"
  127. 1260 PRINTCHR$136;CHR$130;" Best of luck!":*FX21,0
  128. 1270 PROCone_or_two_players:VDU23;8202;0;0;0;
  129. 1280 PRINT''CHR$133"Any key to continue.";
  130. 1290 REPEATUNTILGET$<>""
  131. 1300 ENDPROC
  132. 1310 :
  133. 1320 DEFPROCsetup
  134. 1330 x%=17+RND(5):y%=10+RND(5):l%=15:r%=15:xd%=1:yd%=1:IF RND(3)>1 xd%=-1
  135. 1340 score_left%=0:score_right%=0:hits%=0:colour%=7
  136. 1350 The_Second_Coming=FALSE:game_over%=FALSE
  137. 1360 VDU23,38,255,255,255,255,255,255,255,255
  138. 1370 VDU23,48,126,66,66,66,66,66,66,126,23,49,24,8,8,8,8,8,8,8
  139. 1380 VDU23,50,126,2,2,126,64,64,64,126,23,51,126,2,2,62,2,2,2,126
  140. 1390 VDU23,52,66,66,126,2,2,2,2,2,23,53,126,64,64,126,2,2,2,126
  141. 1400 VDU23,54,126,64,64,126,66,66,66,126,23,55,126,2,2,2,2,2,2,2
  142. 1410 VDU23,56,126,66,66,126,66,66,66,126,23,57,126,66,66,126,2,2,2,126
  143. 1420 edge$=STRING$(39,CHR$38)
  144. 1430 bat$=CHR$38+CHR$8+CHR$10+CHR$38+CHR$8+CHR$10+CHR$38
  145. 1440 nobat$=CHR$32+CHR$8+CHR$10+CHR$32+CHR$8+CHR$10+CHR$32
  146. 1450 ball$=CHR$38
  147. 1460 ENDPROC
Advertisement
Add Comment
Please, Sign In to add comment