-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlunar-lander.c64basic.txt
164 lines (164 loc) · 6.29 KB
/
lunar-lander.c64basic.txt
1
0 REM--AHOY--APRIL ISSUE--LUNAR LANDER--PROG PAGE 355 REM DEC.19, 19836 POKE53280,8:POKE53281,010 PRINT"“ LUNAR LANDER"20 PRINT" (C) COPYRIGHT 1983"30 PRINT" BY ANTHONY WOOD"50 POKE55,248:POKE56,157:REM 4044060 CLR:S=54272100 V=53248:S1=64*13:S2=64*14:S3=64*15:K=2040:SR=40444110 FORZ=0TO39:READA:POKE40456+Z,A120 POKES2+Z,A:POKES3+Z,A:NEXT130 FOR Z=40TO62:READA:POKE40456+Z,A:NEXT132 FORZ=40TO62:READA:POKES2+Z,A:NEXT134 FORZ=40TO62:READA:POKES3+Z,A:NEXT135 FORZ=1TO63*3:READA:POKE40518+Z,A:NEXT137 FORZ=0TO13:READA:POKE40441+Z,A:NEXT138 SYS40441139 FU=5000:F2=0:L1=0:L2=0:SC=0:GOSUB700140 GOSUB900:POKEV+39,1:POKEK,13:POKEV,0:POKEV+1,0:POKEV+21,1150 H=15:E=5:X=30+INT(RND(0)*100):Y=30:F(0)=13:F(1)=13:F(2)=14160 F(3)=15:M=1200 J=PEEK(56320):P=PEEK(197):IFFU=0THENB=0:M=1:POKES+1,0:GOTO220210 IFP=60OR(JAND16)=0THENB=B+1:GOTO213211 B=0:M=1:POKES+4,0213 IFM<>1THENPOKES+4,129215 IF P=7OR(JAND4)=0THENH=H-1:PRINT"<<":FU=FU-1216 IF P=2OR(JAND8)=0THENH=H+1:PRINT">>":FU=FU-1220 GOSUB760:IFB=6ORB=1THENM=M+1240 E=E+GR-M*1.65:FU=FU-(M-1)*10:IFFU<0THENFU=0245 X=X+INT(H/6):Y=Y+INT(E/5)250 IFX<5THENX=5252 IFY>251THENY=252:GOSUB800:Y=35:X=29:RU=5000:F2=1:GOSUB5000255 IFY<35THENY=35:E=3256 IFX>319THENX=319260 POKEK,13:Z=PEEK(V+31):GOSUB800266 IFPEEK(V+31)<>0THEN300270 POKEK,F(M-FL):IFFL=0THENFL=1:GOTO200280 FL=0:GOTO200300 IFF2=1THEN440310 IFY<149THEN270320 IFY<227 ORX<099OR X>123 ORE>9ORABS(H)>10THEN330322 IF L1=1ANDL2=1THEN330325 Y=227:GOSUB800:SC=SC+100:L2=1327 GOTO400330 IFY<177 ORX<197 ORX>203 ORE>9ORABS(H)>10THEN340335 Y=179:GOSUB800:SC=SC+500:L1=1:GOTO400340 POKES+4,129:V2=11:POKESR,63+8:SYS40441:GOSUB820:POKESR,126+8:SYS40441350 GOSUB840:POKESR,189+8:SYS40441:GOSUB840:POKES+4,0:POKES+24,15:POKES+1,2360 POKEV+21,0:POKESR,8:SYS40441:GOTO410400 POKES+4,0:GOSUB750:PRINT" LANDED!!"410 GETA$:IFA$<>"ˆ"THEN410415 POKEV+21,0:PRINT" "420 IFFU=0THEN 460425 IFF2=1THENY=10:X=29:E=5:H=0:GOSUB5000:POKEV,X:POKEV+1,Y:POKEV+21,1:GOTO160435 GOTO140440 IFX<230ORX>242ORY<121ORY>130ORE>9ORABS(H)>11THEN340450 F2=0:SC=SC+1000:L1=0:L2=0:FU=4500:GOTO400460 PRINT"“":PRINT:PRINT"DO YOU WANT TO PLAY AGAIN?"470 GETA$:IFA$=""THEN470480 IFA$="Y"THEN139490 IFA$<>"N"THEN470500 POKES+4,0:PRINT"“":END700 PRINT:PRINT:PRINT" ENTER GRAVITY STRINGTH (1’,2’, OR 3’)"701 POKES+5,129:POKES+6,216:POKES+24,15702 POKES,200:POKES+4,0:POKES+1,2710 GETA$:IFA$=""THEN710715 IFA$="1"THENGR=3:RETURN720 IFA$="2"THENGR=3.6:RETURN730 IFA$="3"THENGR=4.25:RETURN740 GOTO710750 PRINT"SCORE";SC;760 PRINT" ";TAB(28);"FUEL ";FU;:RETURN800 POKEV+1,Y:IFX<256THENPOKEV,X:POKEV+16,0:RETURN810 POKEV,X-256:POKE53264,127:RETURN820 POKES+1,3:FORX=1TO4:POKES+24,V2:FORY=1TO15:NEXT:V2=V2+1830 NEXT:RETURN840 FORX=1TO7:POKES+24,V2:FORY=1TO9:NEXT:V2=V2-1:NEXT:RETURN900 PRINT"“":GOSUB750:PRINT:FORY=0TO9:A=RND(0)910 IFA>.3THENPRINTTAB(RND(0)*39);"."920 IF A<=.3THENPRINT930 NEXT:PRINT:PRINT:PRINT1000 PRINT" ©ß’ "1100 PRINT" © ß’ "1200 PRINT" © ß’ "1300 PRINT" © ß’ "1400 PRINT" © ß’"1500 PRINT" ©500 ß’"1600 PRINT" ©ß’ © ’"1700 PRINT" © ß’ © ’"1800 PRINT" © ß’ © ’"1900 PRINT"© ß’ © ’"1910 PRINT" 100 ’";1920 IFL2=1ANDL1=1THENPRINT"ß’ ©’";1930 RETURN1999 REM LANDER SPRITES2000 DATA 0,255,0,0,255,0,7,255,224,72010 DATA 255,224,7,255,224,0,255,0,0,2552020 DATA 0,15,255,240,15,255,240,15,255,2402030 DATA 3,255,192,3,60,192,6,126,96,122040 REM NO FLAME2050 DATA 0,48,24,0,24,0,0,0,0,02060 DATA 0,0,0,0,0,0,0,0,0,0,0,0,02070 REM SMALL FLAME2080 DATA 0,48,24,60,24,0,102,0,0,602090 DATA 0,0,24,0,0,24,0,0,0,0,0,0,02100 REM BIG FLAME2110 DATA 0,48,24,126,24,0,219,0,0,2192120 DATA 0,0,102,0,0,60,0,0,24,0,0,24,02130 REM EXPLOSION2140 DATA 0,0,0,0,0,0,0,02150 DATA 0,0,0,0,0,0,0,02160 DATA 64,0,6,72,0,0,24,02170 DATA 12,224,0,0,228,0,0,02180 DATA 0,13,80,0,0,0,0,02190 DATA 0,0,0,0,0,0,0,0,0,0,0,0,02200 DATA 0,0,0,0,0,0,0,0,0,02210 REM FRAME 2 OF EXPLOSION2220 DATA 0,0,0,0,0,0,0,02230 DATA 0,0,128,0,24,131,0,242240 DATA 3,0,0,0,0,0,0,02250 DATA 48,224,0,48,227,0,0,02260 DATA 0,0,0,0,28,0,0,242270 DATA 152,0,2,8,0,0,64,02280 DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,02290 REM FRAME 3 OF EXPLOSION2300 DATA 0,0,0,0,0,0,0,02310 DATA 0,0,128,128,24,129,0,242320 DATA 0,0,0,0,0,0,0,02330 DATA 64,0,0,64,0,112,0,02340 DATA 0,0,0,0,32,0,208,322350 DATA 0,0,0,0,0,0,2,02360 DATA 4,65,0,4,64,128,0,02370 DATA 0,0,0,0,0,0,02380 REM BLOCK MOVE2390 DATA 162,0,189,8,158,157,64,3,2322400 DATA 224,63,208,245,964999 REM DRAW CAVE5000 PRINT"“":GOSUB750:PRINT:POKES+4,0:POKES+1,25005 PRINT" "5010 PRINT" "5020 PRINT" "5030 PRINT" "5040 PRINT" "5050 PRINT" ’© ß© ß ’© ß "5060 PRINT" ’ "5065 PRINT" ’ "5070 PRINT" ’ "5080 PRINT" ’ ¯¯¯¯ "5090 PRINT" ’ "5100 PRINT" 1000 ’) "5200 PRINT" ’) "5210 PRINT" ’) "5220 PRINT" ’) "5230 PRINT" ß©ß©ß©ß©ß ’©ß ’©ß©ß ’©ß© "5240 PRINT" ß© © ’"5250 PRINT" © ’"5260 PRINT" © ’"5270 PRINT" © ’"5280 PRINT" © ’"5285 PRINT" ©ß’ ’"5290 PRINT" ’"5295 PRINT" ’";5300 PRINT"";TAB(38);" ’";6000 RETURN