home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
amos
/
hit_the_target.amos
/
hit_the_target.amosSourceCode
Wrap
AMOS Source Code
|
1995-03-16
|
3KB
|
151 lines
Screen Open 0,320,256,16,Lowres
Curs Off : Flash Off : Hide On : Cls 0
' loading title picture
' Check to see if it's a 1 Meg Machine
If Chip Free>250000
MEG1=1
Else
MEG1=0
End If
If Exist("Df0:Hit_The_Target.Bak")
Kill "Df0:Hit_The_Target.Bak"
End If
Load "Graphics/gun.pic"
Unpack 5 To 0
Erase 5
Repeat
Until Fire(1) or Fire(0)
Cls 0
Load "Graphics/tent.pic"
Unpack 5 To 0
Erase 5
Load "Graphics/targets.abk"
If MEG1=1
Load "Sound/Piano-Piece.Abk"
Music 1
End If
Double Buffer
HI=0
X=75 : Y=0
Global X,Y,MEG1,HI
SETUPLOT
'
Procedure SETUPLOT
X=75 : Y=0
Global X,Y
Get Sprite Palette
MOVETARGETS
MOVEGUN
End Proc
'
Procedure MOVETARGETS
Bob 1,20,130,1 : Bob 2,275,80,2 : Bob 3,20,41,3 : Bob 0,20,130,1
Channel 0 To Bob 0 : Channel 1 To Bob 1 : Channel 2 To Bob 2 : Channel 3 To Bob 3
Amal 0,"L:M 255,0,20;M -255,0,20;J L"
Amal 1,"L:M 255,0,60;M -255,0,60;J L" : Amal 2,"L:M -255,0,40;M 255,0,40;J L" : Amal 3,"L:M 255,0,50;M -255,0,50;J L"
Amal On
End Proc
'
Procedure MOVEGUN
Bob 4,X,Y,4
A$="Let R0=1 ; "
A$=A$+"A: If J1&1 then Jump E ;" : Rem up
A$=A$+"B: If J1&2 then Jump F ;" : Rem down
A$=A$+"C: If J1&4 then Jump G ;" : Rem left
A$=A$+"D: If J1&8 then Jump H ;" : Rem right
A$=A$+"Jump A ;"
A$=A$+"G: Let X=X-R0 ; Jump D ;"
A$=A$+"H: Let X=X+R0 ; Jump A ;"
A$=A$+"E: Let Y=Y-R0 ; Jump B ;"
A$=A$+"F: Let Y=Y+R0 ; Jump C ;"
Bob 4,160,100,4
Channel 4 To Bob 4
Amal 4,A$
Amal On 4
Do
Pen 1 : Paper 0 : Curs Off
SHOT
If X=0 Then OVER
If X>=10
Print At(3,30)+"SHOTS",X
Else
Print At(3,30)+"SHOTS",X;" "
End If
Print At(20,30)+"SCORE",Y
Loop
End Proc
'
Procedure SHOT
If Bob Col(4,0 To 3) and Fire(1) or Fire(0)
X=X-1
If Bob Col(4,0 To 0)
Amal Off 0
Bob 0,20,130,1
Channel 0 To Bob 0
Amal 0,"L:M 255,0,20;M -255,0,20;J L"
Amal On 0
Y=Y+50
End If
If Bob Col(4,1 To 1)
Amal Off 1
Bob 1,20,130,1
Channel 1 To Bob 1
Amal 1,"L:M 255,0,60;M -255,0,60;J L"
Amal On 1
Y=Y+10
End If
If Bob Col(4,2 To 2)
Amal Off 2
Bob 2,275,80,2
Channel 2 To Bob 2
Amal 2,"L:M -255,0,40;M 255,0,40;J L"
Amal On 2
Y=Y+30
End If
If Bob Col(4,3 To 3)
Amal Off 3
Bob 3,20,41,3
Channel 3 To Bob 3
Amal 3,"L:M 255,0,50;M -255,0,50;J L"
Amal On 3
Y=Y+20
End If
End If
If Fire(1) or Fire(0) and Not Bob Col(4,0 To 3)
Paste Bob X Bob(4)-10,Y Bob(4)-10,5
X=X-1
End If
End Proc
'
Procedure OVER
Amal Off
Bob Off
Cls 0
Print At(10,10)+"Your Score Was";Y
If Y>HI
HI=Y
Centre At(,11)+"You also have set a new Hi-Score!"
End If
Centre At(,13)+"Hi Score:"+Str$(HI)
Centre At(,15)+"Press A Key"
Curs Off
Wait Key
SETUPSCREEN1
End Proc
'
Procedure SETUPSCREEN1
Cls 0
Load "Graphics/tent.pic"
Unpack 5 To 0
Erase 5
Double Buffer
SETUPLOT
End Proc
'
' Congratulations must go to NICK on his FIRST EVER AMOS game.
' ------------------------------------------------------------
' (I Will take the credit for the Music though!)
'
' All of Nick's original Code is here, plus a few extras that I
' added.....
'