REM Acorn Invaders REM Packed by MH's BASCrunch v1.31c 30/1/08 On 04 Feb 2008 ONERRORREPORT:PRINT" at line ";ERL:END aa%=FALSE:ba%=TRUE:ca%=0:DIMa$(10),b%(10):DIMc%(10):SYS"OS_SWINumberFromString",,"OS_SpriteOp"TOda%:ea%=FNl(".Resources.Gfx0"):ea%+=256:DIMN% ea%:!N%=ea%:N%!4=0:N%!8=16:N%!12=16:f$=".Resources.Gfx0" IFFNe(f$)<>1THENERROR255,"File Missing!!" SYSda%,256+10,N%,f$:SYSda%,256+17,N%:IFFNe(".Resources.HiTable")<>1THEN IFNOTFNmTHENba%=FALSE ELSE:PROCk ENDIF c%=0:d%=4:e%=8:h%=12:D%=16:E%=20:u%=24:V%=28:fa%=32:ga%=36:ha%=40:ia%=44:ja%=48:ka%=16:la%=20:ma%=24:A%=28:J%=32:W%=fa%:na%=ga%:DIMb% 36,G% 52:MODE28:OFF:PROCh:b%!A%=FNa(8,1):b%!J%=FNa(8,2)+7:G%!e%=FNa(6,1):G%!h%=FNa(6,2):G%!W%=b%!h%-50:G%!na%=30 REPEAT:CLS:aa%=FNn:IFNOTaa%THENCLS:PROCl UNTILaa%:CLS:PROCi("GOODBYE!!!",10):END DEFFNn:LOCALi%,K%,L%,k%,p%,a$,x%,a%,F%,O%:LOCALX%,t%,y%,s$:DIMK% 16,L% 16,k% 16:DIMa% 16,F% 16:K%!e%=FNa(100,1):K%!h%=FNa(40,2):K%!c%=FNd(K%,b%):K%!d%=800:L%!e%=FNa(150,1):L%!h%=FNa(40,2):L%!c%=FNd(L%,b%):L%!d%=K%!d%-L%!h% k%!e%=630:k%!h%=500:k%!c%=FNd(k%,b%):k%!d%=200:a%!e%=FNa(40,1):a%!h%=FNa(20,2):a%!c%=k%!c%+150:a%!d%=(k%!d%+k%!h%)-160:F%!e%=FNa(20,1):F%!h%=FNa(20,2):F%!c%=k%!c%+150+FNd(F%,a%):O%=FNf(F%,16):X%=FNf(F%,16) F%!d%=k%!d%+100:O%!d%=F%!d%+F%!h%+40:X%!d%=O%!d%+O%!h%+40:PROCd(G%!W%):PROCd(G%!na%):FORi%=0-K%!e%TOK%!c%STEP5:PROCa("space",i%,K%!d%):PROCe(1):NEXTi%:FORi%=b%!e%TOL%!c%STEP-5:PROCa("invaders",i%,L%!d%):PROCe(1):NEXTi%:a$="PRESS SPACE TO PLAY" p%=LEN(a$)*b%!A%:y%=170:PROCb(FNb(p%,b%!e%),y%,a$,11):a$="OR Q TO QUIT":p%=LEN(a$)*b%!A%:y%-=b%!J%:PROCb(FNb(p%,b%!e%),y%,a$,11):WHILENOTINKEY(-99)ANDNOTINKEY(-17)ANDNOTINKEY(-82):PROCc(k%):a$="SCORE ADVANCE":p%=LEN(a$)*b%!A%:x%=k%!c%+FNb(p%,k%!e%):y%=k%!d%+k%!h%-20 PROCb(x%,y%,a$,0):a$="TABLE":y%-=b%!J%:p%=LEN(a$)*b%!A%:x%=k%!c%+FNb(p%,k%!e%):PROCb(x%,y%,a$,0):x%=a%!c%+a%!e%+10:PROCa("saucer_0",a%!c%,a%!d%):PROCb(x%,a%!d%+10,"= 500 POINTS !",0):PROCa("inv_3",X%!c%,X%!d%):PROCb(x%,X%!d%+20,"= 100 POINTS !",0) PROCa("inv_2",O%!c%,O%!d%):PROCb(x%,O%!d%+20,"= 75 POINTS !",0):PROCa("inv_1",F%!c%,F%!d%):PROCb(x%,F%!d%+20,"= 50 POINTS !",0):t%=TIME+750:REPEAT:IFINKEY(-82)THENPROCg UNTILTIME=t%ORINKEY(-17)ORINKEY(-99):IFINKEY(-17)THEN=TRUE IFINKEY(-99)THEN=FALSE PROCc(k%):a$="TODAY'S":IFba%THENa$="ALL TIME" p%=LEN(a$)*b%!A%:x%=k%!c%+FNb(p%,k%!e%):y%=k%!d%+k%!h%-20:PROCb(x%,y%,a$,0):a$="HI SCORES":y%-=b%!J%:p%=LEN(a$)*b%!A%:x%=k%!c%+FNb(p%,k%!e%):PROCb(x%,y%,a$,0):y%=(k%!d%+k%!h%)-100:a$=" POS."+STRING$(21," ")+"SCORE."+STRING$(3," ")+"RACK." p%=LEN(a$)*b%!A%:x%=k%!c%+FNb(p%,k%!e%):PROCb(x%,y%,a$,0):y%-=2*b%!J%:FORi%=1TO10:IFi%<10THEN a$=" "+STR$(i%)+". " ELSE:a$=" "+STR$(i%)+". " ENDIF s$=FNi(a$(i%)):a$+=FNc(s$,8," ",FALSE):a$+=" .... ":a$+=FNj(STR$(b%(i%)),10):a$+=" ... "+FNj(STR$(c%(i%)),3):p%=LEN(a$)*b%!A%:x%=k%!c%+FNb(p%,k%!e%):PROCb(x%,y%-(i%*(b%!J%+5)),a$,0):NEXTi%:t%=TIME+750:REPEAT:IFINKEY(-82)THENPROCg UNTILTIME=t%ORINKEY(-17)ORINKEY(-99):IFINKEY(-17)THEN=TRUE IFINKEY(-99)THEN=FALSE ENDWHILE:IFINKEY(-17)THEN=TRUE =FALSE DEFPROCl:LOCALm%,j%,a%,g%,B%:LOCALH%:LOCALa%():LOCALY%,oa%,R%,Z%:LOCALpa%,p%,a$,x%,y%:DIMm% 52,j% 52,a% 52,g% 52,H% 16,a%(10,6):DIMB% 16:Y%=0:_%=4:oa%=8:qa%=12:R%=fa%:Z%=ga%:v%=ha%:`%=ia%:ra%=ja%:m%!e%=FNa(30,1):m%!h%=FNa(15,2):m%!c%=FNd(m%,b%) m%!d%=50:m%!E%=6:m%!D%=m%!E%:j%!e%=FNa(5,1):j%!h%=FNa(20,2):j%!u%=FALSE:j%!E%=10:a%!e%=FNa(40,1):a%!h%=FNa(20,2):a%!d%=G%!W%-(10+a%!h%):a%!E%=5:a%!u%=FALSE:a%!ia%=TRUE:H%!e%=FNa(20,1):H%!h%=FNa(20,2) g%!Z%=FNa(20,1):g%!`%=10:g%!ra%=6:g%!u%=TRUE:B%!oa%=1:B%!_%=0:B%!Y%=3:B%!qa%=FALSE:PROCd(G%!W%):PROCd(G%!na%):PROCm(0,b%(1),B%!Y%,B%!oa%):PROCn:PROCj:PROCa("base",m%!c%,m%!d%):REPEAT:pa%=FALSE:IFINKEY(-74)THENPROCo(m%!c%,m%!d%) IFINKEY(-98)THENPROCp:pa%=TRUE IFINKEY(-67)THENPROCq:pa%=TRUE IFINKEY(-82)THENPROCg IFINKEY(-17)THENPROCr IFpa%THEN m%!c%+=m%!D%:PROCa("base",m%!c%,m%!d%) ENDIF PROCs:PROCt:PROCu:UNTILB%!Y%=0:PROCi("GAME OVER!!!",11):PROCe(750):ENDPROC DEFPROCp:IFm%!c%<=0THEN m%!c%=0 ELSE:m%!D%=0-m%!E% ENDIF ENDPROC DEFPROCq:IFm%!c%>=b%!e%-m%!e%THEN m%!c%=b%!e%-m%!e% ELSE:m%!D%=0+m%!E% ENDIF ENDPROC DEFPROCo(x%,y%):IFNOTj%!u%THEN j%!u%=TRUE:j%!c%=x%+(m%!e%/2):j%!d%=y%+m%!h% ENDIF ENDPROC DEFPROCg:REPEAT:UNTILNOTINKEY(-82):OSCLI"ScreenSave .Dump"+STR$(ca%):ca%+=1:ENDPROC DEFPROCr:B%!Y%=0:B%!qa%=TRUE:ENDPROC DEFPROCs:LOCALsa%,ta%:sa%=fa%:IFj%!u%THEN j%!sa%=FALSE:IFj%!d%>=G%!W%-j%!h%THEN j%!u%=FALSE:j%!sa%=TRUE ENDIF IFj%!sa%THEN ta%=FNf(j%,52):ta%!d%-=2:PROCc(ta%) ELSE:PROCa("shell",j%!c%,j%!d%) ENDIF j%!d%+=j%!E% ENDIF ENDPROC DEFPROCt:LOCALM%,v%,S%,T%:M%=fa%:v%=ga%:S%=ha%:T%=ia%:IFNOTa%!u%THEN IFFNg(4)ANDFNg(5)THEN a%!u%=TRUE:a%!V%=FALSE:a%!S%=0:a%!T%=0:IFFNg(50)THEN a%!D%=0-a%!E%:a%!c%=b%!e% ELSE:a%!D%=0+a%!E%:a%!c%=0-a%!e% ENDIF ENDIF ELSE:a%!S%+=1:a%!v%+=1:IFa%!c%<=0-a%!e%ANDSGN(a%!D%)=-1THEN a%!M%=FALSE:a%!u%=FALSE:a%!v%=0:ENDPROC ENDIF IFa%!c%>b%!e%ANDSGN(a%!D%)=1THEN a%!M%=FALSE:a%!u%=FALSE:a%!v%=0:ENDPROC ENDIF IFNOTa%!V%THEN IFFNh(j%,a%)THEN PROCc(j%):PROCa("saucer_2",a%!c%,a%!d%):a%!M%=a%!v%:a%!V%=TRUE:j%!u%=FALSE:PROCf(500) ENDIF ELSE:IFFNh(j%,a%)THEN PROCc(j%):j%!u%=FALSE ENDIF ENDIF IFNOTa%!V%THEN IFa%!S%>=100THENa%!S%=0 IFa%!S%MOD10=0THEN a%!T%=FNk(a%!T%) ENDIF IFa%!T%=0THEN PROCa("saucer_0",a%!c%,a%!d%) ELSE:PROCa("saucer_1",a%!c%,a%!d%) ENDIF a%!c%+=a%!D% ELSE:IFa%!v%>=a%!M%+125THEN PROCc(a%):a%!u%=FALSE:a%!M%=FALSE:a%!v%=0:a%!T%=TRUE ELSE:IFa%!v%>=a%!M%+100THEN PROCa("saucer_5",a%!c%,a%!d%) ELSE:IFa%!v%>=a%!M%+75THEN PROCa("saucer_4",a%!c%,a%!d%) ELSE:IFa%!v%>=a%!M%+50THEN PROCa("saucer_3",a%!c%,a%!d%) ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDPROC DEFPROCu:LOCALv%,ua%,va%,z%,o%,q%:v%=ha%:g%!v%+=1:IFg%!v%MOD5=0THENg%!R%=FNk(g%!R%) IFg%!v%>10000THENg%!v%=0 ua%=g%!c%+g%!e%:IFua%>=b%!e%THENg%!D%=0-g%!E% IFg%!c%<=0THENg%!D%=0+g%!E% IFFNh(j%,g%)THEN z%=H%!e%+g%!Z%:IF(j%!c%-g%!c%)MODz%<=H%!e%THEN o%=((j%!d%-g%!d%)DIVH%!h%)+1:q%=((j%!c%-g%!c%)DIVz%)+1:IFSGN(a%(q%,o%))=1THEN a%(q%,o%)=-5:PROCc(j%):j%!u%=FALSE:CASEo%OF WHEN1,2:PROCf(50) WHEN3,4:PROCf(75) WHEN5,6:PROCf(100) ENDCASE ENDIF ENDIF ENDIF g%!c%+=g%!D%:PROCj:ENDPROC DEFFNm:LOCALi%,w%,n$:FORi%=1TO10:IFi%MOD2=0THENn$="Software"ELSEn$="DynaByte" a$(i%)=FNi(n$):b%(i%)=(11-i%)*1000:c%(i%)=0:NEXTi%:w%=OPENOUT".Resources.HiTable":IFw%=0THEN=FALSE FORi%=1TO10:PRINT#w%,a$(i%),b%(i%):PRINT#w%,c%(i%):NEXTi%:CLOSE#w%:=TRUE DEFPROCk:LOCALi%,w%:w%=OPENIN".Resources.HiTable":FORi%=1TO10:INPUT#w%,a$(i%),b%(i%):INPUT#w%,c%(i%):NEXTi%:CLOSE#w%:ENDPROC DEFPROCy:LOCALi%,w%:w%=OPENOUT".Resources.HiTable":FORi%=1TO10:PRINT#w%,a$(i%),b%(i%):PRINT#w%,c%(i%):NEXTi%:CLOSE#w%:ENDPROC DEFPROCm(wa%,xa%,l%,r%):LOCALx%,a$:a$="SCORE :-"+FNc(STR$(wa%),10," ",TRUE):PROCb(0,b%!h%-b%!J%,a$,0):a$="HI SCORE :-":a$+=FNc(STR$(xa%),10," ",TRUE):x%=b%!e%-LEN(a$)*b%!A%:PROCb(x%,b%!h%-b%!J%,a$,0):PROCv(l%):PROCw(r%):ENDPROC DEFPROCv(ya%):LOCALa$:PROCa("base",0,0):a$=" = "+STR$(ya%):PROCb(m%!e%,0,a$,0):ENDPROC DEFPROCw(ya%):LOCALx%,a$:a$="RACK :-"+FNc(STR$(ya%),3,"0",TRUE):x%=b%!e%-LEN(a$)*b%!A%:PROCb(x%,0,a$,0):ENDPROC DEFPROCf(za%):LOCALx%,a$:B%!_%+=za%:a$="SCORE :-"+FNc(STR$(B%!_%),10," ",TRUE):PROCb(0,b%!h%-b%!J%,a$,0):IFB%!_%>b%(1)THEN a$="HI SCORE :-":a$+=FNc(STR$(B%!_%),10," ",TRUE):x%=b%!e%-LEN(a$)*b%!A%:PROCb(x%,b%!h%-b%!J%,a$,0) ENDIF ENDPROC DEFPROCn:LOCALo%,q%,s%:g%!c%=50:g%!d%=550:g%!R%=0:g%!V%=0:g%!E%=3:g%!D%=g%!E%:s%=(g%!`%*H%!e%)+((g%!`%-1)*g%!Z%):g%!e%=s%:g%!h%=g%!ra%*H%!h%:FORq%=1TOg%!`%:FORo%=1TOg%!ra%:a%(q%,o%)=((o%+1)/2)+(g%!R%*10):NEXTo%:NEXTq%:ENDPROC DEFPROCj:LOCALo%,q%,x%,y%:FORq%=1TOg%!`%:x%=g%!c%+((q%-1)*(H%!e%+g%!Z%)):FORo%=1TOg%!ra%:y%=g%!d%+((o%-1)*H%!h%):IFa%(q%,o%)>0THEN a%(q%,o%)=((o%+1)/2)+(g%!R%*10) ENDIF IFa%(q%,o%)<>0THEN CASESGN(a%(q%,o%))OF WHEN-1:PROCx(x%,y%) WHEN1:PROCa("inv_"+STR$(a%(q%,o%)),x%,y%) ENDCASE ENDIF NEXTo%:NEXTq%:ENDPROC DEFPROCx(x%,y%):LOCALU%:DIMU% 16:a%(q%,o%)+=1:PROCa("inv_4",x%,y%):IFa%(q%,o%)=0THEN U%!c%=x%:U%!d%=y%:U%!e%=H%!e%:U%!h%=H%!h%:PROCc(U%) ENDIF ENDPROC DEFPROCz:ENDPROC DEFPROCA:ENDPROC DEFPROCd(d%):LOCALi%,Aa%:Aa%=b%!e%/G%!e%:FORi%=1TOAa%+1:PROCa("rail",(i%-1)*G%!e%,d%):NEXTi%:ENDPROC DEFPROCh:LOCALC%:DIMC% 20:C%!0=4:C%!4=5:C%!8=11:C%!12=12:C%!16=-1:SYS"OS_ReadVduVariables",C%,C%:b%!ka%=C%!0:b%!la%=C%!4:b%!e%=(C%!8)+1<b%!ma%THENPROCh CASEBa%OF WHEN1:Ca%=P%<>b%!ka% WHEN4:Ca%=P%>>b%!la% OTHERWISE:ERROR255,"Unknown FNconv_units() operation : "+STR$(Ba%) ENDCASE =Ca% DEFPROCb(x%,y%,a$,Ea%):LOCALi%,Fa%:Fa%=b%!A%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