Last active
December 2, 2024 04:18
-
-
Save fu-sen/c0a0eac1792a6b1349653845bc42fe03 to your computer and use it in GitHub Desktop.
Blastar | original by Elon Reeve Musk | MSX-BASIC | https://msxjpn.jimdofree.com/%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0/blastar/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 COLOR15,0,0 | |
10 SH=5 | |
20 SCREEN,,0:KEYOFF | |
30 ' | |
40 REM BLASTAR BY E.R.MUSK | |
50 ' | |
60 SCREEN3 | |
61 OPEN"GRP:"AS#1 | |
65 DRAW"BM20,64" | |
70 PRINT#1,"BLASTAR" | |
80 ' BLASTAR TUNE | |
90 PLAY"O3L50CECECDBABADACECEBDACDBDCEGG" | |
100 PLAY"O4L50CECECDBABADACECEBDACDBDCEGG" | |
110 PLAY"O3L50CECECDBABADACECEBDACDBDCEGG" | |
120 PLAY"O4L50CECECDBABADACECEBDACDBDCEGG" | |
130 SCREEN1,2 | |
140 PRINT"BY E.R.MUSK" | |
150 FORT=1TO350:NEXTT | |
160 CLS | |
170 LOCATE10,5:PRINT"BLASTAR":PRINT:PRINT" DO YOU NEED INSTRUCTIONS" | |
180 PRINT" (Y/N)" | |
190 LETE$=INKEY$ | |
200 IFE$=""THEN190 | |
210 BEEP | |
220 IFE$="Y"ORE$="y"THEN250 | |
230 GOTO280 | |
240 ' INSTRUCTIONS | |
250 SCREEN2:CIRCLE(45,80),0:DRAW"u70r160d70l160" | |
255 DRAW"BM0,0" | |
260 PRINT#1,"":PRINT#1,"":PRINT#1," < USE JOYSTICK >":PRINT#1,"":PRINT#1," FOR CONTROL AND":PRINT#1,"":PRINT#1," FIRE BUTTON":PRINT#1,"":PRINT#1," TO SHOOT" | |
265 PRINT#1,"":PRINT#1,"":PRINT#1,"":PRINT#1,"MISSION:DESTROY ALIEN FREIGHTER":PRINT#1,"":PRINT#1,"CARRYING DEADLY HYDROGEN BOMBS":PRINT#1,"":PRINT#1,"AND STATUS BEAM MACHINES" | |
270 IFINKEY$=""THEN270 | |
280 SCREEN1 | |
290 ' CREATE SPRITES | |
300 FORR=1TO8 | |
310 READM$ | |
320 T$=T$+CHR$(VAL("&B"+M$)) | |
330 NEXTR | |
340 SPRITE$(1)=T$ | |
350 FORT=1TO8 | |
360 READS$ | |
370 D$=D$+CHR$(VAL("&B"+S$)) | |
380 NEXTT | |
390 SPRITE$(2)=D$ | |
410 FORR=1TO8 | |
420 READX$ | |
430 V$=V$+CHR$(VAL("&B"+X$)) | |
440 NEXTR | |
450 SPRITE$(3)=V$ | |
460 FORY=1TO8 | |
470 READY$ | |
480 N$=N$+CHR$(VAL("&B"+Y$)) | |
490 NEXTY | |
500 SPRITE$(4)=N$ | |
510 FORT=1TO8 | |
520 READL$ | |
530 J$=J$+CHR$(VAL("&B"+L$)) | |
540 NEXTT | |
550 SPRITE$(5)=J$ | |
560 ' MAIN PROGRAM | |
570 LOCATE0,0 | |
580 PRINT"SCORE";SC;" SHIPS";SH | |
590 LETP=120:C=180 | |
600 H=30:G=15 | |
610 SPRITEON | |
620 F=STRIG(0)+STRIG(1) | |
630 D=STICK(0)+STICK(1) | |
640 PUTSPRITE3,(H,G),14,3 | |
650 IFD=0THEN740 | |
660 IFD=1THENP=P+0:C=C-4 | |
670 IFD=2THENP=P+2:C=C-2 | |
680 IFD=3THENP=P+4:C=C+0 | |
690 IFD=4THENP=P+2:C=C+2 | |
700 IFD=5THENP=P+0:C=C+4 | |
710 IFD=6THENP=P-2:C=C+2 | |
720 IFD=7THENP=P-4:C=C+0 | |
730 IFD=8THENP=P-2:C=C-2 | |
740 PUTSPRITE0,(P,C),14,1 | |
750 IFC<10THENC=10 | |
760 IFC>190THENC=180 | |
770 IFP<10THENP=10 | |
780 IFP>240THENP=240 | |
790 IFY=1THENRETURN | |
800 PUTSPRITE3,(H,G),14,3 | |
810 IFH=PTHEN1050:IFH=P-1THEN1050:IFH=P+1THEN1050 | |
820 H=H+3 | |
830 IFH>250THENH=10 | |
840 IFF=-1THEN870 | |
850 GOTO620 | |
860 ' SHOOT ROCKETS | |
870 U=P:W=C-5 | |
880 PLAY"O4V6L50DL30F" | |
890 PUTSPRITE3,(H,G),14,3 | |
910 H=H+4 | |
920 W=W-6 | |
940 PUTSPRITE2,(U,W),9,2 | |
950 IFH=PTHEN1050 | |
960 Y=1:GOSUB620:Y=0 | |
970 SPRITEON | |
980 ONSPRITEGOSUB1020 | |
990 IFF=-1THEN870 | |
1000 IFW<-10THEN620 | |
1010 GOTO890 | |
1020 IFW=C-5THEN940 | |
1030 SC=SC+80:FORA=1TO20:PUTSPRITE3,(H,G),8,4:NEXTA:CLS:LOCATE0,0:PRINT"SCORE";SC;" SHIPS";SH:SPRITEOFF:PUTSPRITE2,(0,205):G=20+INT(150*RND(-TIME)):H=0:GOTO620 | |
1040 ' ALIEN STATUS BEAM/ROCKET BOMB | |
1050 OO=H:NN=G+5 | |
1060 : | |
1070 SPRITEON | |
1080 NN=NN+4 | |
1090 Y=1:PI=P:GOSUB620:Y=0:P=PI | |
1100 LOCATE9,2:PRINT"STATUS BEAM" | |
1110 ONSPRITEGOSUB1180 | |
1120 PUTSPRITE5,(OO,NN),4,5 | |
1130 PLAY"O2L15G" | |
1140 IFNN>205THEN620 | |
1170 GOTO1060 | |
1180 PUTSPRITE0,(P,C),8,4:SH=SH-1:FORT=1TO60:NEXTT:CLS:LOCATE0,0:PRINT"SCORE";SC;" SHIPS";SH:PUTSPRITE5,(128,205),14,5:PUTSPRITE2,(0,205):G=20+INT(170*RND(-TIME)):H=0:SPRITEOFF:IFSH<0THEN1200 | |
1190 GOTO620 | |
1200 CLS:PRINT"SCORE";SC:PRINT:PRINT" BLASTAR":PRINT:PRINT" FLEET DESTROYED":PRINT:PRINT" WOULD YOU LIKE ANOTHER GAME" | |
1205 A$=INKEY$:IFA$<>""THEN1205 | |
1210 A$=INKEY$:IFA$=""THEN1210 | |
1220 IFA$="Y"ORA$="y"THENRUN | |
1230 END | |
1250 ' SPRITE DATA | |
1260 DATA10011001 | |
1270 DATA10011001 | |
1280 DATA10011001 | |
1290 DATA11100111 | |
1300 DATA11000011 | |
1310 DATA11000011 | |
1320 DATA11000011 | |
1330 DATA11000011 | |
1340 DATA00000000 | |
1350 DATA00000000 | |
1360 DATA01000010 | |
1370 DATA10100101 | |
1380 DATA01000010 | |
1390 DATA00000000 | |
1400 DATA00000000 | |
1410 DATA00000000 | |
1420 DATA00011000 | |
1430 DATA01000010 | |
1440 DATA11100111 | |
1450 DATA10111101 | |
1460 DATA01011010 | |
1470 DATA00100100 | |
1480 DATA00111100 | |
1490 DATA01100110 | |
1500 DATA01010110 | |
1510 DATA11001101 | |
1520 DATA10010101 | |
1530 DATA01011011 | |
1540 DATA00011001 | |
1550 DATA11010011 | |
1560 DATA01100101 | |
1570 DATA01011100 | |
1580 DATA00000000 | |
1590 DATA00010000 | |
1600 DATA00111000 | |
1610 DATA01111100 | |
1620 DATA01111100 | |
1630 DATA00111000 | |
1640 DATA00010000 | |
1650 DATA00000000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I fixed the text position and fixed some bugs.
The original only uses a joystick, but this program allows you to use the arrow keys (STICK(0)) and SPACE key(STRIG(0)) instead.