home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1995-03-07 | 10.4 KB | 367 lines |
- ' Ben AMOS Version
- ' Ein sehr altes Spiel... Das letzte mal d�rfte ich vor 2-3 Jahren dran
- ' gearbeitet haben... die Routinen sind sehr speziell und wahrscheinlich
- ' f�r Dich nutzlos... :-(
- ' Und vorallem sind sie saumies.
- Set Buffer 50
- Dim F(5+19+5,5+19+5,1),M(5+19+5,5+19+5)
- 'GRABICONS
- 'Wait Key
- Unpack 7 To 0
- Paper 0 : Pen 1
- Double Buffer
- Autoback 0
- Bob Update Off
- Make Icon Mask
- For YS=0 To 29
- For XS=0 To 29
- F(XS,YS,0)=1 : M(XS,YS)=0
- Next
- Next
- Reserve As Work 10,928
- ST=Start(10)
- Bload "BenLevels/1",ST
- For YS=0 To 19
- For XS=0 To 19
- F(XS+5,YS+5,0)=Peek(ST+XS*2+YS*40)
- F(XS+5,YS+5,1)=Peek(ST+XS*2+YS*40+1)
- Next
- Next
- XO=0 : YO=0
- XB=4 : YB=1 : DB=3
- Set Rainbow 0,15,90,"","",""
- C0=15 : C1=0 : C2=0
- For A=0 To 89
- D0=C0 : D1=C1 : D2=C2
- If C0=15 and C1<15 and C2=0 Then Inc D1
- If C0>0 and C1=15 Then Dec D0
- If C0=0 and C1=15 and C2<15 Then Inc D2
- If C1>0 and C2=15 Then Dec D1
- If C1=0 and C2=15 and C0<15 Then Inc D0
- If C0=15 and C2>0 Then Dec D2
- C0=D0 : C1=D1 : C2=D2
- Rain(0,A)=C0*$100+C1*$10+C2
- Next
- RAI=0
- A$="L Y=YH(0,56); L A=128; L X=0; A: P; L X=X+2; I X<90 J A; L X=X-90; J A;"
- Channel 0 To Rainbow 0
- Amal 0,A$
- Amal On
- XA=-1 : YA=-1 : UP=0
- Do
- ' Home : Print Timer;" "
- Wait Vbl : Timer=0
- If XA<>XB or YA<>YB Then UP=2 : XA=XB : YA=YB
- If UP
- Gosub COMDIR
- Gosub MAKEMAP
- Gosub KARTUP
- Gosub MAKEGFX
- Dec UP
- End If
- Screen Swap
- For YYY=YB+3 To YB+7
- For XXX=XB+3 To XB+7
- F=F(XXX,YYY,0)
- If F=11 and CC=1 Then F(XXX,YYY,0)=10 : UP=2
- If F=10 and CC=1 Then F(XXX,YYY,0)=8 : UP=2
- If F=10 and CC=0 Then F(XXX,YYY,0)=11 : UP=2
- If F=11 and CC=0 Then F(XXX,YYY,0)=9 : UP=2
- Next
- Next
- I$=Inkey$
- If I$=Cup$ Then Gosub SCHUBS
- If I$=Cdown$
- RX=-RX : RY=-RY : Gosub SCHUBS : RX=-RX : RY=-RY
- End If
- If I$=Cleft$ Then Add DB,-1,0 To 3 : UP=2
- If I$=Cright$ Then Add DB,1,0 To 3 : UP=2
- XB=Min(Max(XB,0),19)
- YB=Min(Max(YB,0),19)
- XO=Min(Max(XB-4,0),12)
- YO=Min(Max(YB-4,0),12)
- Loop
- Wait Key
- End
- SCHUBS:
- F=F(XB+5+RX,YB+5+RY,0)
- If F=6 Then Repeat : XB=Rnd(19) : YB=Rnd(19) : Until F(XB+5,YB+5,0)=0
- If F=0 or F=7
- Add XB,RX : Add YB,RY
- Else
- If F>7 and F<12
- FF=F(XB+5+RX*2,YB+5+RY*2,0)
- RS=0
- If FF=0
- F(XB+5+RX*2,YB+5+RY*2,0)=F
- If F=9
- RS=7 : CC=1
- F(XB+5+RX*2,YB+5+RY*2,0)=11
- End If
- If F/2=5 and CC=0
- CC=1 : RS=7
- End If
- End If
- If FF=7
- If F=8
- F(XB+5+RX*2,YB+5+RY*2,0)=10
- CC=0
- Else
- F(XB+5+RX*2,YB+5+RY*2,0)=F
- RS=7
- End If
- End If
- If FF=0 or FF=6 or FF=7
- F(XB+5+RX,YB+5+RY,0)=RS
- Add XB,RX : Add YB,RY
- End If
- End If
- End If
- Return
- MAKEMAP:
- For A=0 To 4
- XX=XB+5+RX*A : YY=YB+5+RY*A
- F=F(XX,YY,0) : M(XX,YY)=1
- If F>0 and F<6 Then Exit
- If F=7 Then M(XX+RX,YY+RY)=1 : Exit
- Next
- MB=0
- For A=0 To 4
- XX=XB+5+RX*A+RY : YY=YB+5+RY*A-RX
- F=F(XX,YY,0)
- If(F=0 or F>5) and MB>0 Then Exit
- M(XX,YY)=1
- If F>0 and F<6 and MB=0 Then MB=A
- Next
- TL=MB : MB=0
- For A=0 To 4
- XX=XB+5+RX*A-RY : YY=YB+5+RY*A+RX
- F=F(XX,YY,0)
- If(F=0 or F>5) and MB>0 Then Exit
- M(XX,YY)=1
- If F>0 and F<6 and MB=0 Then MB=A
- Next
- TR=MB : MB=0
- If TL>2
- For A=1 To TL
- XX=XB+5+RX*A+RY*2 : YY=YB+5+RY*A-RX*2
- F=F(XX,YY,0)
- If(F=0 or F>5) and MB>0 : Exit : End If
- M(XX,YY)=1
- If F>0 and F<6 and MB=0 : MB=A : End If
- Next
- MB=0
- End If
- If TR<3 Then Return
- MB=0
- For A=1 To TR
- XX=XB+5+RX*A-RY*2 : YY=YB+5+RY*A+RX*2
- F=F(XX,YY,0)
- If(F=0 or F>5) and MB>0 Then Exit
- M(XX,YY)=1
- If F>0 and F<6 and MB=0 Then MB=A
- Next
- Return
- KARTUP:
- Ink 0 : Bar 240,48 To 303,111
- For YS=0 To 7
- For XS=0 To 7
- If M(XS+5+XO,YS+5+YO) Then Paste Icon 240+XS*8,48+YS*8,F(XS+5+XO,YS+5+YO,0)+74
- Next
- Next
- Paste Icon 240+(XB-XO)*8,48+(YB-YO)*8,86+DB
- Return
- COMDIR:
- If DB=0 Then RX=0 : RY=-1
- If DB=1 Then RX=1 : RY=0
- If DB=2 Then RX=0 : RY=1
- If DB=3 Then RX=-1 : RY=0
- Return
- MAKEGFX:
- Clip 32,56 To 208,176
- Paste Icon 32,56,1
- ' Links vorne X-2,Y-4
- F=F(XB+5+RX*4+RY*2,YB+5+RY*4-RX*2,0)
- If F>0 and F<6 Then Paste Icon 32,90,13
- If F=6 Then Paste Icon 32,90,25
- ' Links vorne X-1,Y-4
- F=F(XB+5+RX*4+RY,YB+5+RY*4-RX,0)
- If F>0 and F<6 Then Paste Icon 68,90,13
- If F=6 Then Paste Icon 58,90,25
- ' Rechts vorne X+2,Y-4
- F=F(XB+5+RX*4-RY*2,YB+5+RY*4+RX*2,0)
- If F>0 and F<6 Then Paste Icon 176,90,13
- If F=6 Then Paste Icon 174,90,25
- ' Rechts vorne X+1,Y-4
- F=F(XB+5+RX*4-RY,YB+5+RY*4+RX,0)
- If F>0 and F<6 Then Paste Icon 140,90,13
- If F=6 Then Paste Icon 140,90,25
- ' Direkt vorne X ,Y-4
- F=F(XB+5+RX*4,YB+5+RY*4,0)
- If F>0 and F<6 Then Paste Icon 104,90,13
- If F=6 Then Paste Icon 104,90,25
-
- ' Links vorne X-2,Y-3
- F=F(XB+5+RX*3+RY*2,YB+5+RY*3-RX*2,0)
- If F>0 and F<6 Then Paste Icon 0,84,12 : Paste Icon 48,86,67
- If F=6 Then Paste Icon 0,84,24 : Paste Icon 48,86,71
- If F=7 Then Paste Icon 10,110,64
- ' Links vorne X-1,Y-3
- F=F(XB+5+RX*3+RY,YB+5+RY*3-RX,0)
- If F>0 and F<6 Then Paste Icon 48,84,12 : Paste Icon 96,80,5
- If F=6 Then Paste Icon 48,84,24 : Paste Icon 96,80,17
- If F=7 Then Paste Icon 58,110,64
- If F>7 and F<12 Then Gosub GECA : Paste Icon 58,90,33+BB*9 : Paste Icon 86,90,34+BB*9
- ' Rechts vorne X+2,Y-3
- F=F(XB+5+RX*3-RY*2,YB+5+RY*3+RX*2,0)
- If F>0 and F<6 Then Paste Icon 192,84,12 : Paste Icon 176,86,69
- If F=6 Then Paste Icon 192,84,24 : Paste Icon 176,86,73
- If F=7 Then Paste Icon 206,110,64
- ' Rechts vorne X+1,Y-3
- F=F(XB+5+RX*3-RY,YB+5+RY*3+RX,0)
- If F>0 and F<6 Then Paste Icon 144,84,12 : Paste Icon 136,80,9
- If F=6 Then Paste Icon 144,84,24 : Paste Icon 136,80,21
- If F=7 Then Paste Icon 158,110,64
- If F>7 and F<12 Then Gosub GECA : Paste Icon 158,90,33+BB*9 : Paste Icon 150,90,32+BB*9
- ' Direkt vorne X ,Y-3
- F=F(XB+5+RX*3,YB+5+RY*3,0)
- If F>0 and F<6 Then Paste Icon 96,84,12
- If F=6 Then Paste Icon 96,84,24
- If F=7 Then Paste Icon 106,110,64
- If F>7 and F<12 Then Gosub GECA : Paste Icon 106,90,33+BB*9
-
- ' Links vorne X-2,Y-2
- F=F(XB+5+RX*2+RY*2,YB+5+RY*2-RX*2,0)
- If F>0 and F<6 Then Paste Icon 24,78,66
- If F=6 Then Paste Icon 24,78,70
- ' Links vorne X-1,Y-2
- F=F(XB+5+RX*2+RY,YB+5+RY*2-RX,0)
- If F>0 and F<6 Then Paste Icon 0,76,11 : Paste Icon 80,72,4
- If F=6 Then Paste Icon 0,76,23 : Paste Icon 80,72,16
- If F=7 Then Paste Icon 20,120,63
- If F>7 and F<12 Then Gosub GECA : Paste Icon 12,80,30+BB*9 : Paste Icon 68,80,31+BB*9
- ' Rechts vorne X+2,Y-2
- F=F(XB+5+RX*2-RY*2,YB+5+RY*2+RX*2,0)
- If F>0 and F<6 Then Paste Icon 192,78,68
- If F=6 Then Paste Icon 192,78,72
- ' Rechts vorne X+1,Y-2
- F=F(XB+5+RX*2-RY,YB+5+RY*2+RX,0)
- If F>0 and F<6 Then Paste Icon 160,76,11 : Paste Icon 144,72,8
- If F=6 Then Paste Icon 160,76,23 : Paste Icon 144,72,20
- If F=7 Then Paste Icon 180,120,63
- If F>7 and F<12 Then Gosub GECA : Paste Icon 172,80,30+BB*9 : Paste Icon 164,80,29+BB*9
- ' Direkt vorne X ,Y-2
- F=F(XB+5+RX*2,YB+5+RY*2,0)
- If F>0 and F<6 Then Paste Icon 80,76,11
- If F=6 Then Paste Icon 80,76,23
- If F=7 Then Paste Icon 100,120,63
- If F>7 and F<12 Then Gosub GECA : Paste Icon 92,80,30+BB*9
-
- ' Links vorne X-1,Y-1
- F=F(XB+5+RX+RY,YB+5+RY-RX,0)
- If F>0 and F<6 Then Paste Icon -72,64,10 : Paste Icon 56,64,3
- If F=6 Then Paste Icon -72,64,22 : Paste Icon 56,64,15
- If F=7 Then Paste Icon -40,136,62
- If F>7 and F<12 Then Gosub GECA : Paste Icon -32,68,27+BB*9 : Paste Icon 48,68,28+BB*9
- ' Rechts vorne X+1,Y-1
- F=F(XB+5+RX-RY,YB+5+RY+RX,0)
- If F>0 and F<6 Then Paste Icon 184,64,10 : Paste Icon 160,64,7
- If F=6 Then Paste Icon 184,64,22 : Paste Icon 160,64,19
- If F=7 Then Paste Icon 200,136,62
- If F>7 and F<12 Then Gosub GECA : Paste Icon 192,68,27+BB*9 : Paste Icon 184,68,26+BB*9
- ' Direkt vorne X ,Y-1
- F=F(XB+5+RX,YB+5+RY,0)
- If F>0 and F<6 Then Paste Icon 56,64,10
- If F=6 Then Paste Icon 56,64,22
- If F=7 Then Paste Icon 80,136,62
- If F>7 and F<12 Then Gosub GECA : Paste Icon 80,68,27+BB*9
- If F>1 and F<6 and(F-2)=((DB+2) mod 4) Then Paste Icon 104,88,65
- ' Links von Ben X-1,Y
- F=F(XB+5+RY,YB+5-RX,0)
- If F>0 and F<6 Then Paste Icon 32,56,2
- If F=6 Then Paste Icon 32,56,14
- ' Rechts von Ben X+1,Y
- F=F(XB+5-RY,YB+5+RX,0)
- If F>0 and F<6 Then Paste Icon 184,56,6
- If F=6 Then Paste Icon 184,56,18
- Clip 0,0 To 320,200
- Return
- GECA:
- If F=8 Then BB=0
- If F=9 Then BB=3
- If F=10 Then BB=1
- If F=11 Then BB=2
- Return
- Procedure GRABICONS
- Load Iff "Ben4.iff",0
- Screen Offset 0,320,0
- Screen Display 0,128,40,320,264
- Colour 0,0
- ' Floor and Ceiling
- Get Icon 1,0,0 To 176,120
- ' Left Sidewall pieces
- Get Icon 2,0,120 To 24,240
- Get Icon 3,24,120 To 48,216
- Get Icon 4,48,120 To 64,182
- Get Icon 5,64,120 To 72,160
- Get Icon 66,624,0 To 648,56
- Get Icon 67,648,8 To 664,48
- ' Right Sidewall pieces
- Get Icon 9,72,120 To 80,160
- Get Icon 8,80,120 To 96,182
- Get Icon 7,96,120 To 120,216
- Get Icon 6,120,120 To 144,240
- Get Icon 69,624,64 To 640,104
- Get Icon 68,640,56 To 664,112
- ' Front Walls
- Get Icon 10,176,0 To 304,96
- Get Icon 11,304,0 To 384,60
- Get Icon 12,304,64 To 352,100
- Get Icon 13,352,64 To 384,88
- ' Left Sideteleport pieces
- Get Icon 14,144,120 To 168,240
- Get Icon 15,168,120 To 192,216
- Get Icon 16,192,120 To 208,182
- Get Icon 17,208,120 To 216,160
- Get Icon 70,624,112 To 648,168
- Get Icon 71,648,120 To 664,160
- ' Right Sideteleport pieces
- Get Icon 21,216,120 To 224,160
- Get Icon 20,224,120 To 240,182
- Get Icon 19,240,120 To 264,216
- Get Icon 18,264,120 To 288,240
- Get Icon 73,624,176 To 640,216
- Get Icon 72,640,168 To 664,224
- ' Front Teleports
- Get Icon 22,384,0 To 512,96
- Get Icon 23,512,0 To 592,60
- Get Icon 24,512,64 To 560,100
- Get Icon 25,560,64 To 592,88
- ' Cases
- X=288 : Y=104 : B=0
- For A=0 To 3
- ' Big Case
- Get Icon 26+B,X,Y To X+8,Y+80
- Get Icon 27+B,X+8,Y To X+88,Y+80
- Get Icon 28+B,X+88,Y To X+96,Y+80
- ' Medium Case
- Get Icon 29+B,X+96,Y To X+104,Y+52
- Get Icon 30+B,X+104,Y To X+160,Y+52
- Get Icon 31+B,X+160,Y To X+168,Y+52
- ' Small Case
- Get Icon 32+B,X+96,Y+52 To X+104,Y+80
- Get Icon 33+B,X+104,Y+52 To X+132,Y+80
- Get Icon 34+B,X+132,Y+52 To X+140,Y+80
- Add B,9
- Add X,168 : If X>472 Then X=288 : Add Y,80
- Next
- ' Case Target
- Get Icon 62,144,240 To 224,256
- Get Icon 63,224,240 To 264,256
- Get Icon 64,264,240 To 288,256
- ' Wall Button
- Get Icon 65,176,96 To 216,120
- For A=0 To 15
- Get Icon 74+A,A*8,240 To A*8+8,248
- Next
- End Proc