home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1978-08-29 | 23.3 KB | 801 lines |
- Set Buffer 10
- Erase 1
- Erase 3
- Erase 4
- Erase 5
- Rem simple check to see if 1meg or better memory
- MEG1=Sgn(Fast Free)-(Chip Free>500000)
- Rem just in case someone has all chip memory
- Dir$="Amos_data:"
- Rem set arrays
- Dim BOP$(10),BAD$(4,2),BADX(4,2),BADY(4,2),BADF(4,2),APLX(2),APLY(2),APLS(2),APLL(2)
- Dim APLSC(8),APLV(8),APLS$(8),APR(8),RSEL(16)
- NUMBAD=3 : Rem 3 baddies
- Rem read in baddy AMAL strings
- APPLEREAD
- Gosub BADDYREAD
- SETGAMEOVER
- XSIZE=32 : YSIZE=32
- GTBLCKS
- Hide On
- Do
- LVL=0
- If MEG1
- Load "Music/Music.abk",4
- Load "Music/MFRIFF.ABK",3
- BANK3=2
- SWPMUSIC2
- Music 1
- Led Off
- Else
- Erase 3
- Erase 4
- End If
- Auto View Off
- Screen Open 0,320,200,16,Lowres
- Curs Off : Flash Off
- Fade 1
- Load "Magic_Forest/back1.abk",5
- Unpack 5 To 0
- If Length(1)>0
- Bob Off
- Sprite Off
- Update
- Wait Vbl
- Erase 1
- End If
- Hide On
- Load "Magic_Forest/MFtitle.ABK",1
- TITLES
- Erase 5
- Bob Off
- Erase 1
- Load "Magic_Forest/MFSPRITES.ABK",1
- LIVES=3
- SCORE=0
- Repeat
- Load "Magic_Forest/back"+Chr$(49+LVL mod 2)+".abk",5
- Unpack 5 To 0
- Erase 5
- If MEG1=0
- Load "Music/MFRIFF.ABK",3
- BANK3=2
- Else
- SWPMUSIC1
- End If
- Music 1
- Led Off
- GTMAP[1+LVL]
- Fade 7
- TAMEVIEW[0,0,10,6,XSIZE,YSIZE]
- Wait 150
- Auto View Off
- Screen 0
- Fade 1
- Screen Open 1,320,20,16,Lowres
- Screen Display 1,,254,,10
- Get Sprite Palette
- Wait Vbl
- Curs Off : Flash Off
- Cls 0
- Ink 9,0
- Text 20,7,"SCORE:"
- Screen 0
- Screen To Front 0
- TAMEMAP[0,0,0]
- Double Buffer
- Auto View On
- Bob Off
- SPD=1
- If LVL mod 2=0 and LVL<4
- Bob 2,160,184,19
- Else
- Bob 2,999,1,19
- End If
- Bob 10,330,0,37
- Bob 11,330,0,35
- SET_BADDIES
- A=0
- Repeat
- APLS(A)=0
- APLL(A)=0
- Inc A
- Until A=2
- Get Sprite Palette
- APPLES=10+LVL
- DEAD=0
- WIN=0
- Bob 1,0,0,4
- Channel 1 To Bob 1
- Amal 1,"Move 0,0,1"
- Amal On 1
- Synchro Off
- Autoback 0
- Auto View Off
- Update Off
- TU=1
- T$="00000"
- OSC=-1
- Screen 1
- SETUPAPPLES[APPLES,LIVES]
- Screen 0
- Music Off
- Screen 1
- Fade 1 To 0
- Screen 0
- Repeat
- DEAD=0
- X=160 : Y=192 : XO=X : YO=Y
- Bob 1,X,Y,D*3+T/2+4
- COUNT=40-LVL*5
- COUNT2=40
- BLIP=15
- SWPMUSIC1
- Volume 32
- Music 1
- Tempo BLIP
- MTV=0
- Repeat
- V=0
- VY=Y-YO
- A$="Let A="+Str$(D*3+T/2+4)+" ; Move "+Str$(VX)+","+Str$(VY)+",1"
- Amal 1,A$
- Amal On 1
- Update
- Synchro
- View
- YO=Y : VX=0
- Add GTG,1,0 To 7
- Rem check countdown
- If MTV=0
- Dec COUNT
- If COUNT=0
- Inc BLIP
- COUNT=COUNT2
- If BLIP>30
- BLIP=30
- End If
- Tempo BLIP
- End If
- End If
- Rem check for blink
- If D=0 and(Rnd(10)>9 or T<>0)
- Add T,1,0 To 5
- End If
- If SCORE<>OSC
- Gosub UPSCORE
- OSC=SCORE
- End If
- If MTV
- Dec MTV
- If MTV=0
- V=64
- A=0 : Repeat
- Bob 3+A,X Bob(3+A),BADY(LVL,A),14
- Amal Off A+12
- Inc A
- Until A=NUMBAD
- Amal On
- End If
- End If
- If V
- Dec V
- Volume V
- If V=0
- SWPMUSIC1
- Volume 32
- Music 1
- Tempo BLIP
- End If
- End If
- If TU
- Dec TU
- Screen 1
- Ink 12,0
- Text 70,7,SCT$
- Screen 0
- End If
- Rem check for left/right movement
- Rem only possible if alive (dead=0)
- D=0
- If DEAD=0
- XO=X
- If Jleft(1)
- D=-1 : Add X,-4 : Add T,1,0 To 5
- End If
- If Jright(1)
- D=1 : Add X,4 : Add T,1,0 To 5
- End If
- F=0
- If X>308
- X=0
- F=1
- End If
- If X<0
- X=308
- F=1
- End If
- VX=X-XO
- If F
- Bob 1,X,Y,4+T/2+D*3
- VX=0
- End If
- End If
- Rem calculate new y co-ordinate
- YO=Y
- Y=Y+JUMP+FALL+DEAD*4
- If Y>192 and DEAD=0
- Y=192
- End If
- Rem calculate jump
- JO=JUMP
- If JUMP
- Inc JUMP : If JUMP=-1
- JUMP=1
- End If
- If JUMP=6
- JUMP=0
- End If
- End If
- Rem check for fall
- If DEAD=0
- If Y mod 32<8
- P=Peek(Start(6)+4+(XO/32)+(YO/32)*10)
- Else
- P=30
- End If
- If Y>=192
- P=0
- End If
- If Jup(1) and JUMP=0 and FALL=0 and YO mod 32<4 and P<14
- JUMP=-9
- End If
- If P>=13 and JUMP=0
- FALL=4
- End If
- If P<14 and JUMP>=0 and((YO mod 32>=8 and Y mod 32<=16) or Y mod 32<8)
- Y=(Y/32)*32 : JUMP=0
- FALL=0
- End If
- Z=Bob Col(1,3 To 5)
- If Z
- DEAD=1
- End If
- Z=Bob Col(1)
- If Col(11) or Col(10)
- DEAD=1
- End If
- If Col(2) and(JUMP>0 or FALL)
- JUMP=-7-JUMP-FALL+Jup(1)*2
- Anim 2,"(20,3)(21,3)(20,1)(19,1)"
- Channel 2 To Bob 2
- Anim On
- FALL=0
- End If
- Rem check thunderbolt
- If BLIP=30
- If X Bob(10)<0 or X Bob(10)>320 or Y Bob(10)>200
- TX=Rnd(190)+130 : TY=0 : Bob 10,TX,TY,37
- Channel 10 To Bob 10
- Amal 10,"Move -160,220,30"
- Amal On 10
- End If
- End If
- Rem check arrow
- If Rnd(10)>3
- If(X Bob(11)<0 or X Bob(11)>320) and LVL>1
- ARRD=35 : A$="Move -360,0,90"
- If X Bob(11)<0
- ARRD=36 : A$="Move 360,0,90"
- End If
- Bob 11,X Bob(11),Rnd(180)+10,ARRD
- Channel 11 To Bob 11
- Amal 11,A$
- Amal On 11
- End If
- End If
- Rem check apples
- A=0
- Repeat
- If APLS(A)
- If Y Bob(A+6)>=192
- Bob 6+A,999,1,1
- Amal Off 6+A
- If APLS(A)<>19
- APPLES=APPLES+APLV(APLS(A)-16)
- End If
- If APLS(A)>19 and APLS(A)<23
- ELB=0
- ELF=0
- End If
- APLS(A)=0
- Gosub UPSCORE
- End If
- If APLL(A)=0 and Y Bob(6+A) mod 32=0
- AP=Peek(Start(6)+4+X Bob(A+6)/32+(Y Bob(A+6)/32)*MAPX)
- If AP<14
- APLL(A)=1
- Amal Freeze 6+A
- End If
- End If
- Z=Bob Col(A+6,1 To 11)
- If Z
- If Col(1)
- SCORE=SCORE+APLSC(APLS(A)-16)
- If APLS(A)<>19
- APPLES=APPLES-APLV(APLS(A)-16)
- If APLS(A)>=20 and APLS(A)<23
- ELF=0
- ELB=APLS(A)-18
- If ELB=4
- Inc LIVES
- SETUPAPPLES[APPLES,LIVES]
- If MTV=0
- SWPMUSIC2
- End If
- Music 1
- MTV=50
- Volume 63
- Z=0 : Repeat
- Bob 3+Z,X Bob(3+Z),BADY(LVL,Z),14
- Channel 12+Z To Bob 3+Z
- Amal 12+Z,BOP$(Z)
- Amal On 12+Z
- Inc Z
- Until Z=NUMBAD
- ELB=0
- End If
- End If
- If APLS(A)=23
- DEAD=1
- End If
- Else
- If MTV=0
- SWPMUSIC2
- End If
- Volume 63
- Music 1
- MTV=550
- Z=0 : Repeat
- Bob 3+Z,X Bob(3+Z),BADY(LVL,Z),14
- Channel 12+Z To Bob 3+Z
- Amal 12+Z,BOP$(Z)
- Amal On 12+Z
- Inc Z
- Until Z=NUMBAD
- End If
- Bob 8+A,X Bob(6+A),Y Bob(6+A),25
- Channel(8+A) To Bob 8+A
- Amal 8+A,APLS$(APLS(A)-16)
- Amal On 8+A
- APLS(A)=0
- Bob 6+A,999,1,1
- Gosub UPSCORE
- Else
- If Not(Col(8) or Col(9))
- APLL(A)=0
- Amal On 6+A
- End If
- End If
- End If
- Else
- If Rnd(100)>60 or(ELB>0 and ELF=0)
- If ELB>0 and ELF=0
- APLS(A)=19+ELB
- ELF=1
- Else
- APLL(A)=0
- Z=Rnd(16)
- APLS(A)=RSEL(Z)
- If APLS(A)=20 and(ELF=1 or ELB>0)
- APLS(A)=16
- End If
- End If
- Bob 6+A,Rnd(300)+10,0,APR(APLS(A)-16)
- Channel(6+A) To Bob 6+A
- If APLS(A)<20 or APLS(A)=23
- Amal 6+A,"Move 0,240,60"
- Else
- ELB=APLS(A)-19
- ELF=1
- Amal 6+A,"Move 0,240,45"
- End If
- Amal On 6+A
- End If
- End If
- Inc A
- Until A>1
- End If
- Until((DEAD=1 and Y>=200) or WIN=1) and TU=0
- If DEAD=1
- WIN=0
- Y=200
- Update On
- Synchro On
- Bob 1,X,Y,39 : Bob 15,X,Y-12,40
- A$="Move 0,12,6 ; Anim 0,(40,3)(41,3)(42,3)(43,3) ;"
- A$=A$+" Move 0,-8,4 ; Move 0,8,4 ; Move 0,-6,3 ; Move 0,6,3 ; Move 0,-4,2 ;"
- A$=A$+" Move 0,4,2 ; Move 0,-2,1 ; Move 0,2,1 ;"
- A$=A$+"Move 340,0,320"
- Channel 15 To Bob 15
- Amal 15,A$
- Amal On 15
- While X Bob(15)<330 : Wend
- Amal Off 15
- Bob Off 15
- Update Off
- Synchro Off
- End If
- If WIN=0
- Dec LIVES
- SETUPAPPLES[APPLES,LIVES]
- End If
- Until LIVES=0 or WIN=1
- If WIN
- Inc LVL
- SCORE=SCORE+LVL*1000
- Gosub UPSCORE
- End If
- Until DEAD=1 or LVL=5
- Music Off
- Load "Music/Magic_Forest_end.abk"
- Volume 63
- Update On
- Auto View On
- Screen 0
- Screen To Front 0
- Amal Off
- Synchro On
- Bob 8,999,1,1 : Bob 9,999,1,1
- A=1 : Repeat
- Amal A,"Move 0,480,140"
- Amal On A
- Inc A
- Until A=10
- While Y Bob(5)<260
- Wend
- Amal Off
- Bob Off
- Update
- Erase 1
- Load "magic_forest/MFtitle.abk"
- Del Bob 1
- Music 1
- M=16 : M2=9
- If MEG1=0
- M=6 : M2=4
- End If
- A=1
- Repeat
- If A<M2
- Bob A,50,-10,1
- Else
- Bob A,50,-10,2+WIN
- End If
- Channel(A) To Bob A
- Amal A,"Move 0,0,"+Str$(A*8)+" ; "+GMO$
- Inc A
- Until A=M
- Bob Update
- Amal On
- While Fire(1)=0 and Asc(Inkey$)=0 : Wend
- Screen Close 1
- Music Off
- Loop
- Procedure SETUPAPPLES[AP,L]
- TS=Screen
- Screen 1
- Ink 0 : Bar 123,10 To 320,20
- A=1 : Repeat
- Paste Bob 115+A*8,10,32
- Inc A
- Until A>Min(5,L)
- A=0
- Repeat
- If A<AP
- Paste Bob 165+A*10,10,26
- Else
- Paste Bob 165+A*10,10,25
- End If
- Inc A
- Until A=15
- Screen Copy 1,123,10,320,20 To 1,123,0
- Screen TS
- End Proc
- Procedure SETGAMEOVER
- Shared GMO$
- D=48
- GMO$="H: "
- Repeat
- GMO$=GMO$+"Move 2,"+Str$(D/6)+",2 ; "
- Dec D
- Until D=-49
- GMO$=GMO$+"Let X=50 ; Let Y=-10 ; Jump H"
- End Proc
- Rem
- Rem
- UPSCORE:
- TS=Screen
- Screen 1
- Ink 15,0
- SCT$=Right$("0000"+Mid$(Str$(SCORE),2),5)
- TU=1
- If APPLES<>OAP
- SETUPAPPLES[APPLES,LIVES]
- End If
- If APPLES<=0
- WIN=1
- APPLES=0
- OAP=0
- End If
- If APPLES>15
- DEAD=1
- APPLES=13
- OAP=0
- Update On
- SETUPAPPLES[APPLES,LIVES]
- Update Off
- End If
- Screen 0
- OAP=APPLES
- Return
- Rem _________________________________________________________________
- Rem Game initialisation routines
- Rem
- BADDYREAD:
- Rem reads in the AMAL strings for the baddies
- Rem I Should really store them on disk, but it doesn't work too well
- Rem at the moment !
- Restore D1
- L=0 : Repeat
- A=0 : Repeat
- Read BADX(L,A),BADY(L,A),BADF(L,A)
- Read BAD$(L,A)
- If Right$(BAD$(L,A),1)=" "
- Read BAD2$
- BAD$(L,A)=BAD$(L,A)+BAD2$
- End If
- Inc A
- Until A=NUMBAD
- Inc L
- Until L=5
- Read BOP$,B2$,B3$,B4$,B5$
- BOP$=BOP$+B2$+B3$
- A=0 : Repeat
- Read BOP$(A)
- BOP$(A)=BOP$+Str$(A)+B4$+B5$
- Inc A
- Until A=NUMBAD
- Rem level 1 baddies
- D1:
- Data 96,128,10,"A: Let X=96 ; Anim 12,(10,2)(11,2)(12,2)(11,2) ; Move -96,0,48 ; Let X=319 ; Move -96,0,48 ; Anim 12,(13,2)(14,2)(15,2)(14,2) ; Move 96,0,48 ; Let X=0 ; Move 96,0,48 ; Jump A"
- Data 64,64,10,"B: Let X=64 ; Anim 8,(10,2)(11,2)(12,2)(11,2) ; Move -64,0,32 ; Let X=319 ; Move -64,0,32 ; Anim 8,(13,2)(14,2)(15,2)(14,2) ; Move 64,0,32 ; Let X=0 ; Move 64,0,32 ; Jump B"
- Data 96,32,10,"C: Let X=96 ; Anim 6,(13,2)(14,2)(15,2)(14,2) ; Move 112,0,56 ; Anim 6,(10,2)(11,2)(12,2)(11,2) ; Move -112,0,56 ; Jump C"
- Rem level 2 baddies
- Data 320,128,10
- Data "A: Let X=320 ; Anim 10,(10,2)(11,2)(12,2)(11,2) ; Move -160,0,80 ; Anim 10,(13,2)(14,2)(15,2)(14,2) ; Move 160,0,80 ; Let X=0 ; Let Y=64 ; Anim 4,(13,2)(14,2)(15,2)(14,2) ; Move 64,0,32 ; Anim 4,(10,2)(11,2)(12,2)(11,2) ; Move -64,0,32 ; "
- Data "Let X=0 : Let Y=128 ; Anim 6,(13,2)(14,2)(15,2)(14,2) ; Move 96,0,48 ; Anim 6,(10,2)(11,2)(12,2)(11,2) ; Move -96,0,48 ; Jump A"
- Data 128,64,10,"B: Let X=128 ; Anim 6,(13,2)(14,2)(15,2)(14,2) ; Move 96,0,48 ; Anim 6,(10,2)(11,2)(12,2)(11,2) ; Move -96,0,48 ; Jump B"
- Data 64,32,10,"C: Let X=64 ; Anim 6,(13,2)(14,2)(15,2)(14,2) ; Move 96,0,48 ; Anim 6,(10,2)(11,2)(12,2)(11,2) ; Move -96,0,48 ; Jump C"
- Rem level 3 baddies
- Data 96,128,10,"A: Let X=96 ; Anim 12,(10,2)(11,2)(12,2)(11,2) ; Move -96,0,48 ; Let X=319 ; Move -96,0,48 ; Anim 12,(13,2)(14,2)(15,2)(14,2) ; Move 96,0,48 ; Let X=0 ; Move 96,0,48 ; Jump A"
- Data 160,64,10,"B: Let X=160 ; Anim 18,(10,2)(11,2)(12,2)(11,2) ; Move -160,0,80 ; Let X=319 ; Move -128,0,64 ; Anim 18,(13,2)(14,2)(15,2)(14,2) ; Move 128,0,64 ; Let X=0 ; Move 160,0,80 ; Jump B"
- Data 96,32,10,"C: Let X=96 ; Anim 6,(13,2)(14,2)(15,2)(14,2) ; Move 112,0,56 ; Anim 6,(10,2)(11,2)(12,2)(11,2) ; Move -112,0,56 ; Jump C"
- Rem level 4 baddies
- Data 320,128,10
- Data "A: Let X=320 ; Anim 10,(10,1)(11,1)(12,1)(11,1) ; Move -160,0,40 ; Anim 10,(13,1)(14,1)(15,1)(14,1) ; Move 160,0,40 ; Let X=0 ; Let Y=64 ; Anim 4,(13,1)(14,1)(15,1)(14,1) ; Move 64,0,16 ; Anim 4,(10,1)(11,1)(12,1)(11,1) ; Move -64,0,16 ; "
- Data "Let X=0 : Let Y=128 ; Anim 6,(13,1)(14,1)(15,1)(14,1) ; Move 96,0,24 ; Anim 6,(10,1)(11,1)(12,1)(11,1) ; Move -96,0,24 ; Jump A"
- Data 128,64,10,"B: Let X=128 ; Anim 6,(13,2)(14,2)(15,2)(14,2) ; Move 96,0,48 ; Anim 6,(10,2)(11,2)(12,2)(11,2) ; Move -96,0,48 ; Jump B"
- Data 64,32,10,"C: Let X=64 ; Anim 6,(13,2)(14,2)(15,2)(14,2) ; Move 96,0,48 ; Anim 6,(10,2)(11,2)(12,2)(11,2) ; Move -96,0,48 ; Jump C"
- Rem level 5 baddies
- Data 96,128,10,"A: Let X=96 ; Anim 12,(10,2)(11,2)(12,2)(11,2) ; Move -96,0,48 ; Let X=319 ; Move -96,0,48 ; Anim 12,(13,2)(14,2)(15,2)(14,2) ; Move 96,0,48 ; Let X=0 ; Move 96,0,48 ; Jump A"
- Data 64,64,10,"B: Let X=64 ; Anim 8,(10,2)(11,2)(12,2)(11,2) ; Move -64,0,32 ; Let X=319 ; Move -64,0,32 ; Anim 8,(13,2)(14,2)(15,2)(14,2) ; Move 64,0,32 ; Let X=0 ; Move 64,0,32 ; Jump B"
- Data 96,32,10,"C: Let X=96 ; Anim 6,(13,2)(14,2)(15,2)(14,2) ; Move 112,0,56 ; Anim 6,(10,2)(11,2)(12,2)(11,2) ; Move -112,0,56 ; Jump C"
- Rem Bop Routines
- Data "AUtotest( If R1>0 Jump Down else Jump Up"
- Data " ; Down: Let R2=3 ; Let R1=0-R1 ; Let R1=R1/4 ; eXit"
- Data " ; Up: If R2>0 Jump Vp else Jump Wp ; Vp: Let R2=R2-1 ; eXit ; Wp: Let R1=Vumeter(",") ; Let R1=R1/32 ; Let R1=R1*4 ; eXit)"
- Data "Let R1=0 ; Let R2=0 ; L: Move 0,0-R1,1 ; Jump L"
- Data "Let R0=128 ; ","Let R0=64 ; ","Let R0=32 ; "
- Return
- Procedure APPLEREAD
- Shared APLSC(),APLV(),APLS$(),APR(),RSEL()
- Rem reads in the score values for the 3 types of apple
- Rem as well as the AMAL string for the score animation
- A=0 : Repeat
- Read APLSC(A),APLV(A),APR(A),APLS$(A)
- Inc A
- Until A=8
- A=0 : Repeat : Read RSEL(A) : Inc A : Until A=17
- Rem apples (score)
- Data 70,1,16,"Let A=22 ; Move 0,-250,250",200,3,17,"Let A=24 ; Move 0,-250,250",100,2,18,"Let A=23 ; Move 0,-250,250"
- Rem keyboard (500 pts + plays music)
- Data 500,0,27,"Let A=28; Move 0,-250,250"
- Rem coin (500 pts +triggers Dollar Note)
- Data 500,0,29,"Let A=31; Move 0,-250,250"
- Rem Dollar Note (500 pts + triggers extra life)
- Data 500,0,30,"Let A=31; Move 0,-250,250"
- Rem Extra life (gives extra life )
- Data 0,0,32,"Let A=33; Move 0,-250,250"
- Rem poisoned apple
- Data 0,0,34,"Let A=38; Move 0,250,250"
- Rem occurence data
- Data 16,16,16,16,16,16,16,16,16,16,18,18,17,19,20,23,23
- End Proc
- Procedure SET_BADDIES
- Rem sets up the relevant AMAL strings to move the baddies
- Shared LVL,B$,BAD$(),BADX(),BADY(),BADF(),NUMBAD
- A=0 : Repeat
- B$=BAD$(LVL,A)
- Channel(A+3) To Bob A+3
- Bob A+3,BADX(LVL,A),BADY(LVL,A),BADF(LVL,A)
- Amal A+3,B$
- Inc A
- Until A>=NUMBAD
- Amal On
- End Proc
- Procedure SWPMUSIC1
- Shared BANK3,MEG1
- If MEG1
- Music 1
- End If
- If BANK3=2 and MEG1
- Music Off
- Erase 7
- Reserve As Chip Data 7,Length(3)
- Copy Start(3)-8,Start(3)+Length(3) To Start(7)-8
- Erase 3
- Reserve As Chip Data 3,Length(4)
- Copy Start(4)-8,Start(4)+Length(4) To Start(3)-8
- Erase 4
- Reserve As Chip Data 4,Length(7)
- Copy Start(7)-8,Start(7)+Length(7) To Start(4)-8
- M$="Music "
- M2$="SWPMusic"
- A=0 : Repeat
- Poke Start(3)-8+A,Asc(Mid$(M$,A+1,1)) : Poke Start(4)-8+A,Asc(Mid$(M2$,A+1,1))
- Inc A
- Until A=8
- Erase 7
- Reserve As Chip Data 7,256
- Erase 7
- BANK3=1
- End If
- End Proc
- Procedure SWPMUSIC2
- Shared BANK3,MEG1
- If MEG1
- Music 1
- End If
- If BANK3=1 and MEG1
- Music Off
- Erase 7
- Reserve As Chip Data 7,Length(3)
- Copy Start(3)-8,Start(3)+Length(3) To Start(7)-8
- Erase 3
- Reserve As Chip Data 3,Length(4)
- Copy Start(4)-8,Start(4)+Length(4) To Start(3)-8
- Erase 4
- Reserve As Chip Data 4,Length(7)
- Copy Start(7)-8,Start(7)+Length(7) To Start(4)-8
- M$="Music "
- M2$="SWPMusic"
- A=0 : Repeat
- Poke Start(3)-8+A,Asc(Mid$(M$,A+1,1)) : Poke Start(4)-8+A,Asc(Mid$(M2$,A+1,1))
- Inc A
- Until A=8
- Erase 7
- Reserve As Chip Data 7,256
- Erase 7
- BANK3=2
- End If
- End Proc
- Rem _________________________________________________________________
- Rem Title Routines
- Procedure TITLES
- Shared MEG1
- Ink 15,0
- Cls 0
- Del Bob 4
- Del Bob 3
- Del Bob 2
- NICETXT[20,100,"A Game By Aaron Fothergill"]
- NICETXT[20,110,"Graphics By Adam Fothergill"]
- NICETXT[20,120,"A Shadow Software Production"]
- NICETXT[20,130,"For Mandarin Software 1990"]
- NICETXT[20,140,"Thanks to the usual Bunch,"]
- NICETXT[20,150,"Jason,Rick,Chris,Sue & Sue"]
- Get Bob 2,20,90 To 300,160
- Hot Spot 2,120,0
- Unpack 5 To 0
- Screen Clone 1
- Screen 0
- Fade 1
- Screen To Front 0
- If MEG1=0
- Erase 5
- End If
- Double Buffer
- Auto View On
- Fade 10 To 1
- Bob 1,100,199,1
- Bob 2,170,219,2
- Channel 0 To Bob 1
- Channel 1 To Bob 2
- Amal 0,"Move 0,-300,1200"
- Amal 1,"Move 0,-300,1200"
- Amal On
- While Y Bob(1)>-80 and Fire(1)=0 and Asc(Inkey$)=0 : Wend
- Bob Off
- Sprite Off
- Erase 1
- Amal Off
- Screen Close 1
- End Proc
- Procedure NICETXT[X,Y,T$]
- Ink 15,0
- Text X,Y,T$
- Get Block 21,X,Y-6,Len(T$)*10,8,1
- Ink 1,0
- Text X,Y,T$
- Put Block 21,X+1,Y-5
- Del Block 21
- End Proc
- Rem _________________________________________________________________
- Rem
- Rem TAME Engine Routines
- Rem use these in your own programs if you wish (see MAGIC FOREST)
- Rem
- Procedure GTMAP[M]
- Erase 6
- Reserve As Work 6,80
- Bload "Magic_Forest/MAGICFOREST"+Mid$(Str$(M),2)+".MAP",Start(6)
- End Proc
- Procedure GTBLCKS
- Rem this routine converts a screen (screen 2) into blocks for use by TAME
- Rem XSIZE & YSIZE determine the block size (and thus the number of them)
- Shared XSIZE,YSIZE
- Auto View Off
- Screen 0
- Load "Magic_Forest/MFTILES.ABK",5
- Unpack 5 To 1
- Get Palette(1)
- Screen 1
- A=0
- Repeat
- B=0
- Repeat
- Get Block A*(320/XSIZE)+B+1,B*XSIZE,A*YSIZE,XSIZE,YSIZE,1
- Inc B
- Until B>=320/XSIZE
- Inc A
- Until A>=2
- Screen Close 1
- Screen 0
- End Proc
- Procedure TAMEVIEW[TX,TY,TW,TH,XS,YS]
- Rem This routine sets up the window for TAME, and what size tiles you wish
- Rem to use
- Shared XSIZE,YSIZE,MAPX,MAPY,TAMEW,TAMEH,TLX,TLY,BRX,BRY
- MAPX=Deek(Start(6)) : MAPY=Deek(Start(6)+2)
- XSIZE=XS : YSIZE=YS
- TLX=TX : TLY=TY
- TAMEW=TW : TAMEH=TH
- BRX=TLX+TW*XSIZE
- BRY=TLY+TH*YSIZE
- End Proc
- Procedure TAMEMAP[S,X,Y]
- Rem This routine draws the map in the window set by the TAMEVIEW procedure
- Rem on screen S, at map co-ordinates X,Y
- Shared T,XSIZE,YSIZE,MAPX,MAPY,TAMEW,TAMEH,TLX,TLY,BRX,BRY
- A=0
- Repeat
- B=0
- Repeat
- T=1+Peek(Start(6)+4+((B+X) mod MAPX)+((A+Y) mod MAPY)*MAPX) mod 20
- Put Block T,TLX+B*XSIZE,TLY+A*YSIZE
- Inc B
- Until B>=TAMEW
- Inc A
- Until A>=TAMEH
- End Proc