home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1995-12-30 | 11.7 KB | 356 lines |
- ' Game by Asa Margetts
- ' ~~~~~~~~~~~~~~~~~~~~
- ' Firstrate Effex 1995
- ' ~~~~~~~~~~~~~~~~~~~~
- '
- ' If you wish, you can improve/change this game as long as my name
- ' is left on it. It is only a small part of what I've done on it so far.
- ' It seems quite slow, so compile it for more speed.
- '
- ' No sound has been added yet. All GFX files are in banks.
- '
- ' The game itself I started on Sunday, and have given up today (Tuesday)
- ' so have been going just three days.
-
- Hide On : Screen Open 0,320,256,4,Lowres
- Curs Off : Flash Off : Paper 0 : Cls
-
- Unpack 7 To 0 : Screen Open 2,320,256,16,Lowres
- Curs Off : Flash Off : Paper 0 : Cls : Screen Copy 0,0,0,320,256 To 2,0,0
- Palette 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- Fade 3 To 0 : Wait 45 : Screen Close 2 : Unpack 9 To 1 : Screen Hide 1
- Wait 100 : Screen Show 1 : Screen Close 0 : Wait 100 : Fade 2 : Wait 30 : Screen Close 1
-
- ' Variables
- SAGA1=0 : GUN=0 : BULLETS=0 : X=50 : Y=197 : B=1 : SX=10 : SY=0
- Global X,Y,B,GUN,BULLETS,SX,SY,SAGA1
-
- BEGIN:
- Screen Open 0,320,256,16,Lowres
- Curs Off : Flash Off : Paper 0 : Cls
- Unpack 30 To 0 : Palette $202 : Screen Hide 0
- Screen Open 1,640,60,8,Lowres
- Curs Off : Flash Off : Paper 0 : Cls : Screen Hide 1
- Unpack 16 To 2 : Screen Hide 2
- Screen Copy 2,0,0,320,60 To 1,0,0
- Screen Copy 2,0,0,320,60 To 1,320,0
- Screen 1 : Get Palette 2 : Screen Close 2
- Screen Display 1,150,42,280,320 : Screen 0
- Channel 1 To Screen Offset 1
- Amal 1,"L: Let X=0 ; M 320,0,2000 ; J L" : Amal On
- Screen 1 : Palette $202,,,,,$202 : Screen 0
-
- Double Buffer : Screen Offset 0,10,0 : Screen Show 0 : Screen Show 1 : Bob 1,X,Y,B
- _BOBS
- Channel 10 To Bob 15
- Amal 10,"L: Let A=50 ; M 0,-30,30 ; Let A=51 ; M 0,30,30 ; J L"
- Channel 11 To Bob 20
- Amal 11,"L: A 0,(41,4)(42,4)(43,4)(45,4)(44,4)(43,4)(42,4) ; For R0=1 To 10 ; M -100,-20,150 ; M -100,20,150 ; Next R0 ; Let X=1000 ; J L"
- Channel 12 To Bob 21
- Amal 12,"L: A 0,(41,4)(42,4)(43,4)(45,4)(44,4)(43,4)(42,4) ; For R0=1 To 10 ; M -100,80,60 ; M -100,-80,60 ; Next R0 ; Let X=1000 ; J L"
- For I=10 To 12 : Amal On I : Next I
-
- Wait Vbl : Bob Update Off : Timer=0
- Reserve Zone 3
- Set Zone 1,294,165 To 319,166
- Set Zone 2,555,165 To 616,166
- Set Zone 3,769,165 To 792,166
-
- Do
- Bob 1,X,Y,B
-
- UPPERS
- FALL
-
- Gosub HOLES
- Gosub _COLLISIONS
-
- If Jright(1) Then Timer=0 : RIGHT
- If Jleft(1) Then Timer=0 : LEFT
- If Jdown(1) Then Timer=0 : _DOWN
- If Fire(1) and GUN=1 Then Timer=0 : BANG
- If Jup(1) Then Timer=0 : UP
-
- If Key State(69)=True Then Goto GAMEOVER
-
- LIMITATIONS
- GUNCHECK
-
- If Timer=>200
- Bob Clear
- Repeat
- Bob Clear : Bob 1,X-2,Y+2,15 : Bob Draw : Screen Swap : Wait 8
- Bob Clear : Bob 1,X-2,Y+2,16 : Bob Draw : Screen Swap : Wait 8
- Bob Clear : Bob 1,X-2,Y+2,17 : Bob Draw : Screen Swap : Wait 8
- Bob Clear : Bob 1,X-2,Y+2,18 : Bob Draw : Screen Swap : Wait 8
- Until Joy(1)
- Bob Clear : Timer=0 : B=1 : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait 5
- End If
-
- Bob Clear : Bob Draw : Screen Swap : Wait Vbl
- Loop
-
-
- ' Procedures
- Procedure RIGHT
- Bob Clear
- B=1 : X=X+1 : Bob 1,X,Y,B : _SCROLLRIGHT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- B=2 : X=X+1 : Bob 1,X,Y,B : _SCROLLRIGHT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- B=3 : X=X+1 : Bob 1,X,Y,B : _SCROLLRIGHT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- B=2 : X=X+1 : Bob 1,X,Y,B : _SCROLLRIGHT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- B=1 : X=X+1 : Bob 1,X,Y,B : _SCROLLRIGHT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- Bob Draw : Screen Swap : Wait Vbl
- End Proc
- Procedure LEFT
- Bob Clear
- B=4 : X=X-1 : Bob 1,X,Y,B : _SCROLLLEFT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- B=5 : X=X-1 : Bob 1,X,Y,B : _SCROLLLEFT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- B=6 : X=X-1 : Bob 1,X,Y,B : _SCROLLLEFT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- B=5 : X=X-1 : Bob 1,X,Y,B : _SCROLLLEFT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- B=4 : X=X-1 : Bob 1,X,Y,B : _SCROLLLEFT : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- Bob Draw : Screen Swap : Wait Vbl
- End Proc
- Procedure _DOWN
- Bob Clear
- If Not Y=197
- For I=Y To 197 Step 4
- Bob Clear : Bob 1,X,I,B : Bob Draw : Screen Swap : Wait Vbl : Next I : Bob Clear
- Y=197
- End If
-
- If B=1
- Bob 1,X+2,Y+2,7 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X+2,Y+2,8 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X,Y+2,9 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X,Y+2,10 : Bob Draw : Screen Swap : Wait 8 : Bob Clear
- Repeat : Bob Clear : Bob Draw : Screen Swap : Wait Vbl : Until Joy(1) : Bob Clear
- Bob 1,X,Y+2,9 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X+2,Y+2,8 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X+2,Y+2,7 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait 8 : Bob Clear
- End If
- If B=4
- Bob 1,X,Y+2,11 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X-1,Y+2,12 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X-1,Y+2,13 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X-1,Y+2,14 : Bob Draw : Screen Swap : Wait 8 : Bob Clear
- Repeat : Bob Clear : Bob Draw : Screen Swap : Wait Vbl : Until Joy(1) : Bob Clear
- Bob 1,X-1,Y+2,13 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X-1,Y+2,12 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X,Y+2,11 : Bob Draw : Screen Swap : Wait 1 : Bob Clear
- Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait 8 : Bob Clear
- End If
- Bob Draw : Screen Swap : Wait Vbl : Timer=0
- End Proc
- Procedure UP
- If Bob Col(1,4 To 6) Then Goto MARK
- If Zone(X,Y)=1 or Zone(X,Y)=2 or Zone(X,Y)=3 Then Goto MARK
- If Not Y=197 or Y=198 Then Goto _END
-
- MARK:
- If B=1
- B=3 : Bob Clear : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl
- D=0 : Repeat
- D=D+1 : Y=Y-1 : Bob Clear : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl
- Until D=35 : D=0 : B=1 : Bob Clear : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- End If
- If B=4
- B=6 : Bob Clear : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl
- D=0 : Repeat
- D=D+1 : Y=Y-1 : Bob Clear : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl
- Until D=35 : D=0 : B=6 : Bob Clear : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- End If
-
- _END:
- End Proc
- Procedure BANG
- Bob Clear
- If BULLETS=<0 Then Goto _END
- If B=1
- Bob 1,X,Y-6,20 : Bob Draw : Screen Swap : Wait 3
- Bob Clear : Bob 1,X+2,Y-4,21 : Bob Draw : Screen Swap : Wait 3
- Bob Clear : Bob 1,X+2,Y+1,22 : Bob Draw : Screen Swap : Wait 8
- Bob Clear : Bob 1,X-1,Y-3,26 : Bob Draw : Screen Swap : Wait 5 : X=X-1
- Bob Clear : Bob 1,X+2,Y-4,27 : Bob Draw : Screen Swap : Wait 10 : X=X-1
- Bob 2,X+30,Y+6,19
- Channel 2 To Bob 2
- Amal 2,"L: M 900,0,100" : Amal On
- For I=X To X-50 Step -4 : Bob Clear
- Bob 1,I,,26 : Gosub _COLLISIONS
- If SX=<10 : SX=10 : Screen Offset 0,SX,SY : Goto SKIP : End If
- If X=>840 : Goto SKIP : End If
- SX=SX-4 : Screen Offset 0,SX,SY
- SKIP:
- Bob Draw : Screen Swap : Wait Vbl : Next I : X=X-50
-
- Bob Clear : Bob 1,X-1,Y-3,28 : Bob Draw : Screen Swap : Wait 5 : X=X-1
- Bob Clear : Bob 1,X+2,Y+1,22 : Bob Draw : Screen Swap : Wait 5
- Bob Clear : Bob 1,X+2,Y-4,21 : Bob Draw : Screen Swap : Wait 3
- Bob Clear : Bob 1,X,Y-6,20 : Bob Draw : Screen Swap : Wait 10
- Bob Clear : B=1 : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl : BULLETS=BULLETS-1 : Goto _END
- End If
-
- If B=4
- Bob 1,X-7,Y-7,23 : Bob Draw : Screen Swap : Wait 3
- Bob Clear : Bob 1,X-10,Y-4,24 : Bob Draw : Screen Swap : Wait 3
- Bob Clear : Bob 1,X-12,Y,25 : Bob Draw : Screen Swap : Wait 8
- Bob Clear : Bob 1,X-27,Y-4,29 : Bob Draw : Screen Swap : Wait 5
- Bob Clear : Bob 1,X-27,Y-5,30 : Bob Draw : Screen Swap : Wait 10 : X=X-1
- Bob 2,X-25,Y+2,19
- Channel 2 To Bob 2
- Amal 2,"L: M -900,0,100" : Amal On
- For I=X To X+50 Step 4 : Bob Clear
- Bob 1,I,,30 : Gosub _COLLISIONS
- If SX=>715 : SX=715 : Screen Offset 0,SX,SY : Goto SKIP2 : End If
- If X=<130 : Goto SKIP2 : End If
- SX=SX+6 : Screen Offset 0,SX,SY
- SKIP2:
- Bob Draw : Screen Swap : Wait Vbl : Next I : X=X+80
- Bob Clear : Bob 1,X-27,Y-3,31 : Bob Draw : Screen Swap : Wait 5 : X=X-1
- Bob Clear : Bob 1,X-12,Y,25 : Bob Draw : Screen Swap : Wait 5
- Bob Clear : Bob 1,X-10,Y-4,24 : Bob Draw : Screen Swap : Wait 3
- Bob Clear : Bob 1,X-7,Y-7,23 : Bob Draw : Screen Swap : Wait 10
- Bob Clear : B=4 : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl : BULLETS=BULLETS-1 : Goto _END
- End If
-
- ' Bullet collisions
- ' Bullet hits Saga 1
-
- _COLLISIONS:
-
- If Bob Col(2,15 To 15)
- SAGA1=SAGA1+1
- If SAGA1=>3
- Amal Off 10
- Bob Clear : Bob 15,,,52 : Bob Off 2 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,53 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,54 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,53 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,52 : Bob Draw : Screen Swap : Wait 4 : Bob Clear
- Bob Off 15
- End If
-
- Bob Clear : Bob 15,,,52 : Bob Off 2 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,53 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,54 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,53 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,52 : Bob Draw : Screen Swap : Wait 4
- Bob Clear : Bob 15,,,51 : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- Amal On 10
- End If
-
- If Bob Col(1,20 To 21)
- Bob Clear : Bob Off 2 : Bob Draw : Screen Swap : Wait Vbl : Bob Clear : BULLETS=BULLETS+2
- End If
-
- Return
-
- _END:
- End Proc
-
- Procedure LIMITATIONS
- If X=<10 Then Bob Clear : X=10 : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl : Bob Clear : Bob Draw : Screen Swap : Wait Vbl
- If X=>975 Then Bob Clear : X=975 : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl : Bob Clear : Bob Draw : Screen Swap : Wait Vbl
- If SX=<10 Then SX=10
- End Proc
- Procedure _SCROLLRIGHT
- If SX=>715 Then SX=715 : Goto _END
- If X=<130 Then Goto _END
-
- SX=SX+1 : Screen Offset 0,SX,SY
-
- _END:
- End Proc
- Procedure _SCROLLLEFT
- If SX=<10 Then SX=10 : Goto _END
- If X=>840 Then Goto _END
-
- SX=SX-1 : Screen Offset 0,SX,SY
-
- _END:
- End Proc
-
- Procedure FALL
- If Bob Col(1,4 To 6) Then Goto _END
- If Zone(X,Y)=1 or Zone(X,Y)=2 or Zone(X,Y)=3 Then Goto _END
- If Y=>197 Then Y=197 : Goto _END
-
- Bob Clear
- Y=Y+2 : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- Bob Draw : Screen Swap : Wait Vbl
-
- _END:
- End Proc
- Procedure UPPERS
- If Bob Col(1,4 To 6)
- Bob Clear : Y=Y-1 : Bob 1,X,Y,B : Bob Draw : Screen Swap : Wait Vbl : Bob Clear : Bob Draw : Screen Swap : Wait Vbl
- End If
- End Proc
-
- Procedure _BOBS
- ' Stones
- Bob 4,550,200,32
- Bob 5,150,200,32
- Bob 6,360,202,33
- ' Gun
- Bob 10,320,138,39
- Bob 11,520,150,40
- ' Saga 1
- Bob 15,420,164,50
- ' Bird 1
- Bob 20,900,195,41
- ' Bird 2
- Bob 21,900,100,41
- End Proc
- Procedure GUNCHECK
- If Bob Col(1,10 To 10)
- Bob Clear : Bob Off 10 : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- GUN=1 : BULLETS=BULLETS+6
- End If
-
- If Bob Col(1,11 To 11)
- Bob Clear : Bob Off 11 : Bob Draw : Screen Swap : Wait Vbl : Bob Clear
- BULLETS=BULLETS+6
- End If
-
- End Proc
-
-
- 'Subroutines:
-
- GAMEOVER:
- Bob Update On : Amal Off
- Bob 1,X,Y,34 : Wait 4
- Bob 1,X-4,Y-1,35 : Wait 4
- Bob 1,X-5,Y,36 : Wait 4
- Bob 1,X-5,Y,37 : Wait 4
- Bob 1,X-5,Y,38 : Wait 6 : Bob Off 1
- Screen 1 : A=$111 : Fade 5,,A,A,A,A,$202,A,A,A : Wait 75
- End
-
- HOLES:
- If Y=197 and X=>265 and X=<275 or Y=197 and X=>475 and X=<485 or Y=197 and X=>810 and X=<820 or Y=197 and X=>872 and X=<908
- For I=Y To Y+43 Step 3
- Wait Vbl : Bob Clear : Bob 1,X,I,B : Bob Draw : Screen Swap : Next I
- Y=Y+42 : Goto GAMEOVER
- End If
- Return
-
- _COLLISIONS:
- ' Saga 1
-
- If Bob Col(1,15 To 15)
- Goto GAMEOVER
- End If
-
- ' Bird 1 + 2
- If Bob Col(1,20 To 21)
- Goto GAMEOVER
- End If
- _END:
- Return
-
- End
-
- ' By Asa Margetts 1995 Firstrate Effex
- ' ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~