Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 10 REM BAT N BALL
- 20 REM Byteback Issue Two
- 30 REM September 1993
- 40 *FX200,3
- 45 ON ERROR RUN
- 50 computer%=FALSE
- 60 MODE7:PROCrules
- 70 REPEAT
- 80 PROCsetup
- 90 *TV255
- 100 MODE4:PROCscreen
- 110 VDU23;8202;0;0;0;
- 120 PROCserve:*FX200,2
- 130 REPEAT
- 140 PROCball
- 150 IF hits%<5 delay%=50
- 160 IF hits%>5 AND hits%<10 delay%=20
- 170 IF hits%>10 AND hits%<15 delay%=5
- 180 IF hits%>15 delay%=1
- 190 FOR L=1 TO delay%:NEXT
- 200 PROCleft_bat
- 210 IF computer% PROCcomputer ELSE PROCright_bat
- 220 IF INKEY(-83) colour%=colour%+1:IF colour%>7 colour%=1
- 230 IF INKEY(-83) VDU19,1,colour%,0,0,0
- 240 UNTIL game_over%=TRUE
- 250 PROCgame_over
- 260 UNTIL The_Second_Coming
- 270 :
- 280 DEFPROCleft_bat
- 290 IF NOT(INKEY(-17)OR INKEY(-98)) ENDPROC
- 300 IF INKEY(-17) AND l%>3 PRINTTAB(1,l%)nobat$:l%=l%-1:PRINTTAB(1,l%)bat$
- 310 IF INKEY(-98)AND l%<26 PRINTTAB(1,l%)nobat$:l%=l%+1:PRINTTAB(1,l%)bat$
- 320 ENDPROC
- 330 :
- 340 DEFPROCright_bat
- 350 IF NOT(INKEY(-57)OR INKEY(-105))ENDPROC
- 360 IF INKEY(-57)AND r%>3 PRINTTAB(37,r%)nobat$:r%=r%-1:PRINTTAB(37,r%)bat$
- 370 IF INKEY(-105)AND r%<26 PRINTTAB(37,r%)nobat$:r%=r%+1:PRINTTAB(37,r%)bat$
- 380 ENDPROC
- 390 :
- 400 DEFPROCball
- 410 IF y%+yd%>28 OR y%+yd%<3 yd%=-yd%:SOUND2,-15,100,1
- 420 PRINTTAB(x%,y%)CHR$(32):x%=x%+xd%:y%=y%+yd%:PRINTTAB(x%,y%)ball$
- 430 IF (x%+xd%)>36 PROCcheck_right
- 440 IF (x%+xd%)<2 PROCcheck_left
- 450 ENDPROC
- 460 :
- 470 DEFPROCgame_over
- 480 *FX21,0
- 490 SOUND1,-15,136,1:SOUND1,0,0,1:SOUND1,-15,136,1
- 500 PRINTTAB(9,8)"Another Game (Y/N)?";
- 510 G$=GET$:IF G$<>"Y" AND G$<>"y"CLS:PRINT"Don't Forget To Subscribe to ByteBack!":A=GET:CALL!-4
- 520 computer%=0:RUN
- 530 game_over%=FALSE
- 540 ENDPROC
- 550 :
- 560 DEFPROCcheck_left
- 570 IF y%=1OR y%=(l%+1)OR y%=(l%+2) SOUND1,-15,200,1:xd%=-xd%:hits%=hits%+1:ENDPROC
- 580 FORS%=50 TO 10STEP-10:SOUND1,-15,S%,1:NEXT:score_right%=score_right%+1 :PRINTTAB(33,0);score_right%
- 590 PRINTTAB(x%,y%)CHR$32
- 600 FORloop%=1TO4:PRINTTAB(0,y%)ball$:FORloop2%=1TO1500:NEXT:PRINTTAB(0,y%)CHR$32:FORloop2%=1TO1500:NEXT:NEXT
- 610 IF score_right%>4PROCright_wins:ENDPROC
- 620 hits%=0
- 630 PROCserve
- 640 ENDPROC
- 650 :
- 660 DEFPROCcheck_right
- 670 IF y%=r%OR y%=(r%+1)OR y%=(r%+2)SOUND1,-15,200,1:xd%=-xd%:hits%=hits%+1:ENDPROC
- 680 FORS%=50TO10 STEP-10:SOUND1,-15,S%,1:NEXT:score_left%=score_left%+1:PRINTTAB(5,0);score_left%
- 690 PRINTTAB(x%,y%)CHR$32
- 700 FOR loop1%=1TO4:PRINTTAB(39,y%)ball$:FOR loop2%=1TO1500:NEXT:PRINTTAB(39,y%)CHR$32:FOR loop2%=1TO1500:NEXT:NEXT
- 710 IFscore_left%>4 PROCleft_wins:ENDPROC
- 720 hits%=0
- 730 PROCserve
- 740 ENDPROC
- 750 :
- 760 DEFPROCcomputer
- 770 IF RND(100)>99 ENDPROC
- 780 IF (xd%<0 AND RND(100)>25) ENDPROC
- 790 IF r%<y% AND r%<26 PRINTTAB(37,r%)nobat$:r%=r%+1:PRINTTAB(37,r%)bat$
- 800 IF (r%+1)>y% AND r%>3 PRINTTAB(37,r%)nobat$:r%=r%-1:PRINTTAB(37,r%)bat$
- 810 ENDPROC
- 820 :
- 830 DEFPROCserve
- 840 FOR loop%=1TO1000:NEXT:hits%=0
- 850 PRINTTAB(1,l%)nobat$;TAB(37,r%)nobat$
- 860 x%=17+RND(5):y%=10+RND(5):l%=15:r%=15:xd%=1:yd%=1:IF RND(4)>1 xd%=-1
- 870 IF RND(4)>1 yd%=-yd%
- 880 PRINTTAB(1,l%)bat$;TAB(37,r%)bat$
- 890 PRINTTAB(15,6)"READY ?"
- 900 FOR loop%=1 TO 8000:NEXT
- 910 PRINTTAB(15,6)" "
- 920 ENDPROC
- 930 :
- 940 DEFPROCleft_wins
- 950 game_over%=TRUE
- 960 PRINTTAB(10,6) "Player One Wins!"
- 970 ENDPROC
- 980 :
- 990 DEFPROCright_wins
- 1000 game_over%=TRUE
- 1010 IF computer% PRINTTAB(14,6)"I win!" ELSE PRINTTAB(10,6) "Player Two Wins!"
- 1020 ENDPROC
- 1030 :
- 1040 DEFPROCone_or_two_players
- 1050 PRINT'"1 or 2 Players (1/2) ?";
- 1060 G$=GET$:IFG$<>"1"AND G$<>"2"GOTO1060
- 1070 IF G$="1" computer%=TRUE
- 1080 ENDPROC
- 1090 :
- 1100 DEFPROCscreen
- 1110 PRINTTAB(0,3)edge$;TAB(0,30)edge$
- 1120 PRINTTAB(5,1);score_left%;TAB(33,1);score_right%
- 1130 PRINTTAB(0,31)"BAT 'N' BALL - ByteBack Issue Two"
- 1140 PRINTTAB(1,l%)bat$;TAB(37,r%)bat$
- 1150 ENDPROC
- 1160 :
- 1170 DEFPROCrules
- 1180 PRINTCHR$141;CHR$131;" BAT and BALL - 1993"'CHR$141;CHR$131;" BAT and BALL - 1993"
- 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."
- 1200 PRINT'"The game starts off easy but WATCH OUT! After 5 hits the game speeds up."
- 1210 PRINT'"The first person to reach a score of 5 wins the game."
- 1220 PRINT'"The control keys are as follows:"
- 1230 PRINT"Q LEFT ["
- 1240 PRINT"Z RIGHT /"
- 1250 PRINT'"C changes the screen colour when in play"
- 1260 PRINTCHR$136;CHR$130;" Best of luck!":*FX21,0
- 1270 PROCone_or_two_players:VDU23;8202;0;0;0;
- 1280 PRINT''CHR$133"Any key to continue.";
- 1290 REPEATUNTILGET$<>""
- 1300 ENDPROC
- 1310 :
- 1320 DEFPROCsetup
- 1330 x%=17+RND(5):y%=10+RND(5):l%=15:r%=15:xd%=1:yd%=1:IF RND(3)>1 xd%=-1
- 1340 score_left%=0:score_right%=0:hits%=0:colour%=7
- 1350 The_Second_Coming=FALSE:game_over%=FALSE
- 1360 VDU23,38,255,255,255,255,255,255,255,255
- 1370 VDU23,48,126,66,66,66,66,66,66,126,23,49,24,8,8,8,8,8,8,8
- 1380 VDU23,50,126,2,2,126,64,64,64,126,23,51,126,2,2,62,2,2,2,126
- 1390 VDU23,52,66,66,126,2,2,2,2,2,23,53,126,64,64,126,2,2,2,126
- 1400 VDU23,54,126,64,64,126,66,66,66,126,23,55,126,2,2,2,2,2,2,2
- 1410 VDU23,56,126,66,66,126,66,66,66,126,23,57,126,66,66,126,2,2,2,126
- 1420 edge$=STRING$(39,CHR$38)
- 1430 bat$=CHR$38+CHR$8+CHR$10+CHR$38+CHR$8+CHR$10+CHR$38
- 1440 nobat$=CHR$32+CHR$8+CHR$10+CHR$32+CHR$8+CHR$10+CHR$32
- 1450 ball$=CHR$38
- 1460 ENDPROC
Advertisement
Add Comment
Please, Sign In to add comment