home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
451-475
/
apd465
/
prisonnier.amos
/
prisonnier.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1993-01-08
|
14KB
|
532 lines
' %%%%%%%%%%%%%%%%%%%%%%%%%%%
' %%% PRISONNIER %%%
' %%% ^^^^^^^^^^ %%%
' %%% de Marc Le Douarain %%%
' %%% Avril 1992 %%%
' %%% revu le 22/11/1992. %%%
' %%% %%%
' %%% V 1.4 %%%
' %%%%%%%%%%%%%%%%%%%%%%%%%%%
'
'
' pour me contacter , �crire � :
'
' Le Douarain Marc
' Bourg
' 56390 BRANDIVY
' FRANCE
'
'
Say ""
Music 1
Screen Open 0,320,256,32,Lowres
Paper 0 : Cls : Curs Off : Hide : Flash Off
Get Sprite Palette
Locate 0,3 : Centre "Choice your language !"
Locate 0,5 : Centre "Choisissez votre langue !"
Bob 1,80,100,16 : Bob 2,180,100,17
PREMIERE=0
LANGUE=1
BX=45 : BY=60
Ink 26
Box 75,95 To 75+BX,95+BY
PPA:
A$=Inkey$
If A$=" " Then Goto 1
If A$=Chr$(13) Then Goto 1
If A$="1" and LANGUE=2 Then LANGUE=1 : Goto PPB
If A$="2" and LANGUE=1 Then LANGUE=2 : Goto PPB
Randomize Timer
Goto PPA
PPB:
Ink 0
Box 75,95 To 75+BX,95+BY
Box 175,95 To 175+BX,95+BY
Ink 26
If LANGUE=1 Then Box 75,95 To 75+BX,95+BY
If LANGUE=2 Then Box 175,95 To 175+BX,95+BY
Goto PPA
'
Procedure TIR
Pen 3 : Centre TEX2$
5
If Fire(1)=0 and Fire(0)=0 Then Wait 5 : Goto 5
Flash Off
Fade 3 : Wait 45
End Proc
'
CR:
C=C+1 : If C>2 Then C=1
Pen C
Locate 4,NL : NL=NL+1
Return
'
'
'
1
Locate 7,25
If LANGUE=1 Then Print "(C)lavier ou (J)oystick ?" Else Print "(K)eyboard or (J)oystick ?"
REP:
K$=Inkey$
If K$="" Then Goto REP
If K$="c" Then CLAVIER=1
If K$="k" Then CLAVIER=1
Fade 1 : Wait 15
Bob Off : Cls 0
Double Buffer
Dim X(16),Y(16)
Gosub INIT
If LANGUE=1
TEX1$="Pr�sent� par :"
TEX2$="=> TIR <="
TEX3$=" Arme :"
TEX4$=" Temps :"
TEX5$="La porte est condamn�e !"
TEX6$="Le gardien est le vainqueur !"
TEX7$="Le prisonnier s'est enfui ..."
TEX8$="Pas de vainqueurs !!!"
TEX9$="Et les cl�s,c'est pour qui ???"
TEX10$="Musique ripp�e appel�e : DELTA"
End If
If LANGUE=2
TEX1$="Made by :"
TEX2$="=> FIRE <="
TEX3$=" Ammo :"
TEX4$=" Time :"
TEX5$="This door can't be opened !"
TEX6$="The guardian is the best !"
TEX7$="The prisoner is already far ..."
TEX8$="No winners !!!"
TEX9$="Take the keys , no ???"
TEX10$="Music ripped called : DELTA"
End If
Global TEX2$
'
' Presentation
'
2
CHANGE=0
Autoback 0
Bob Off
Cls 0 : Screen Swap : Cls 0
TT#=1.57
PP=0 : PS=1
Get Sprite Palette
Colour 18,$410
Colour 19,$F01
Bob 1,0,10,14
Channel 1 To Bob 1
Amal 1,"R: M 20,0,30 ; M -20,0,30 ;Jump R"
Pen 11 : Paper 0 : Locate 0,10 : Centre TEX1$ : Locate 0,27 : Centre TEX10$
Screen Swap : Locate 0,10 : Centre TEX1$ : Locate 0,27 : Centre TEX10$
Amal On 1
If PREMIERE=0
For Y=256 To 100 Step -1
Bob 2,113+Cos(TT#)*50,Y,15
TT#=TT#+0.1
Wait Vbl
Next Y
End If
Bob 2,113+Cos(17.27)*50,100,15
23
PREMIERE=1
Autoback 1
Flash 3,"(92c,5)(000,5)"
Locate 0,29 : TIR
Flash Off : Fade 3 : Wait 45
Amal Off
Cls : Screen Swap : Cls
Palette 0,0,0
Flash 3,"(92c,5)(000,5)"
'
Procedure TIR2
Fade 3,,$AAA,$D00
Flash 3,"(92C,5)(000,5)"
Pen 3 : Centre TEX2$
Screen Swap
52 If Fire(1)=0 and Fire(0)=0 Then 52
Flash Off
Fade 2
Wait 30
Cls
End Proc
'
Autoback 0
C=0 : NL=11
If LANGUE=1
Gosub CR : Print "Prisonnier,vous arrivez a vous"
Gosub CR : Print "echappez de votre cellule.Mais"
Gosub CR : Print "une fois dans la cour,l'alerte"
Gosub CR : Print "est donnee."
Gosub CR : Print "Dans la nuit,on voit le halo du "
Gosub CR : Print "projecteur qui vous traque."
Gosub CR : Print "Evitez-le si vous ne voulez pas"
Gosub CR : Print "vous faire tuer par les gardiens."
Print : Print : Print : TIR2
C=0 : NL=11
Gosub CR : Print "Si vous vous perdez dans la nuit,"
Gosub CR : Print "vous pouvez utiliser votre briquet"
Gosub CR : Print "pour vous reperer,mais cela est"
Gosub CR : Print "aussi valable pour les gardiens."
Gosub CR : Print "La premiere cle ouvre les trois"
Gosub CR : Print "premieres portes,et la deuxieme,"
Gosub CR : Print "les trois dernieres de droite."
Print : Print : Print : Print : TIR2
C=0 : NL=11
Gosub CR : Print "Une seule porte sur les six peut"
Gosub CR : Print "s'ouvrir."
Gosub CR : Print "Pour vous donnez du courage,pensez"
Gosub CR : Print "que l'on vous attend de l'autre"
Gosub CR : Print "cote pour prendre la cle des champs!"
Gosub CR : Print "Ne perdez pas de temps,vous n'avez"
Gosub CR : Print "que 80 secondes."
Gosub CR : Print "Le jeu se joue a DEUX JOUEURS."
Gosub CR : Print "Le gardien utilise une deuxieme"
Gosub CR : Print "manette ou le clavier !"
Print : Print : Print : TIR2
C=0 : NL=11
Gosub CR : Print "Le premier joueur,sur le port 1,"
Gosub CR : Print "dirige le prisonnier."
Gosub CR : Print "Le deuxieme joueur,sur le port 0,"
Gosub CR : Print "dirige le gardien."
Gosub CR : Print "Tandis que le prisonnier s'echappe,"
Gosub CR : Print "le gardien essaye de le localiser"
Gosub CR : Print "avec son halo pour lui tirer dessus"
Gosub CR : Print "Les munitions sont limitees !"
Print : Print : Print : TIR2
Locate 0,14
Pen 1 : Centre "BONNE CHANCE !!!" : Print : Print : Print
Pen 2 : Centre "et que le meilleur gagne !" : Print
Print : Print : Print : Print : TIR2
End If
'
If LANGUE=2
Gosub CR : Print "Prisoner,you suceed to escape"
Gosub CR : Print "out of your cell.But arrived"
Gosub CR : Print "in the court , the alarm is"
Gosub CR : Print "given."
Gosub CR : Print "In the night,we can see the"
Gosub CR : Print "halo of the searchlight."
Gosub CR : Print "Avoid it if you don't want to"
Gosub CR : Print "be killed with the guardian."
Print : Print : Print : TIR2
C=0 : NL=11
Gosub CR : Print "To see you in the night,use"
Gosub CR : Print "your lighter.But the guardian"
Gosub CR : Print "can see you also !"
Gosub CR : Print "The FIRST key open the three"
Gosub CR : Print "doors on the left,and the second,"
Gosub CR : Print "the three doors on the right."
Print : Print : Print : Print : TIR2
C=0 : NL=11
Gosub CR : Print "Only one door on the six can be"
Gosub CR : Print "opened."
Gosub CR : Print "To take heart,think that someone"
Gosub CR : Print "wait you on the other side to"
Gosub CR : Print "go away!"
Gosub CR : Print "Your time is limited to 80 seconds."
Gosub CR : Print "This game requires TWO players."
Gosub CR : Print "The guardian uses a second joystick"
Gosub CR : Print "or the keyboard !"
Print : Print : Print : TIR2
C=0 : NL=11
Gosub CR : Print "The FIRST player is the prisoner."
Gosub CR : Print "The SECOND is the guardian."
Gosub CR : Print "While the prisoner escapes,the"
Gosub CR : Print "guardian tries to localize him with"
Gosub CR : Print "his halo to kill him !!!"
Gosub CR : Print "The ammo is limited !"
Print : Print : Print : TIR2
Locate 0,14
Pen 1 : Centre "GOOD LUCK !!!" : Print : Print : Print
Pen 2 : Centre "and which wins the best !" : Print
Print : Print : Print : Print : TIR2
End If
75
'
' *** DECOR ***
'
Screen Open 0,320,256,32,Lowres : Cls 0
Paper 0 : Cls : Curs Off : Hide : Flash Off
Cls 0 : Screen Swap : Cls
Screen Open 1,320,256,2,Lowres
Colour 1,0
Cls 1
Wait Vbl
Screen 0
Ink 16 : Box 50,30 To 66,45 : Circle 58,30,8 : Paint 51,44 : Paint 58,29 : Paint 58,31
Get Bob 30,49,21 To 67,46
Ink 9 : Box 150,30 To 166,45 : Ink 7 : Polyline 150,35 To 166,35 : Ink 11 : Polyline 158,35 To 166,45 To 150,45 To 158,35
Ink 7 : Polyline 150,35 To 150,45 : Polyline 166,45 To 166,35
Ink 7 : Paint 151,36 : Paint 165,36
Ink 9 : Paint 151,31 : Ink 11 : Paint 158,44
Get Bob 32,150,30 To 167,46
Cls 0
Ink 26 : Box 0,0 To 319,45 : Paint 1,1
Ink 22 : For CX=2 To 45 Step 3 : Polyline 0,CX To 319,CX : Next
NB=1
For CX=50 To 110 Step 30 : Bob NB,CX,21,30 : NB=NB+1 : Next CX
For CX=190 To 250 Step 30 : Bob NB,CX,21,30 : NB=NB+1 : Next CX
Wait Vbl
Get Sprite Palette
Screen Close 1
'
' *** JEU ***
'
Every Off
Double Buffer
Pen 13 : Paper 26
PX=Rnd(300)+10 : PY=Rnd(150)+50
GX=150 : GY=100
ARME=20 : TEMPS_INIT=80
GRILLE=Rnd(5)+1
CLEF=0
TPS_RECHARGE=0
VICTOIRE_P=0
TPS_AFFICHE=0
Autoback 0
For MVL=63 To 0 Step -1
Mvolume MVL
Wait Vbl
Next MVL
Music Off : Mvolume 63
Set Talk 1,0,200,130
Say "oh!,the prisoner is out!"
Music 1
Bob 7,75,220,5
Bob 8,215,220,5
Channel 7 To Bob 7
Channel 8 To Bob 8
Amal 7,"Anim 0,(5,5)(6,5)(7,5)(6,5) ; P"
Amal 8,"Anim 0,(7,5)(6,5)(5,5)(6,5) ; P"
Amal On
Timer=0
Update Off
777
Rem -> gestion du prisonnier
J1=Joy(1) and 15
If X(J1)=-1 Then If PX>5 Then Dec PX
If X(J1)=1 Then If PX<305 Then Inc PX
If Y(J1)=-1 Then If PY>43 Then Dec PY
If Y(J1)=1 Then If PY<240 Then Inc PY
Bob 10,PX,PY,1
If Fire(1)=-1 Then Gosub TIR_PRISONNIER
If VICTOIRE_P=1 Then 8000
Rem -> gestion du gardien
If CLAVIER=1 Then 666
J2=Joy(0) and 15
If X(J2)=-1 Then If GX>5 Then Dec GX
If X(J2)=1 Then If GX<305 Then Inc GX
If Y(J2)=-1 Then If GY>43 Then Dec GY
If Y(J2)=1 Then If GY<240 Then Inc GY
If Fire(0)=-1 and ARME>0 and TPS_RECHARGE=0 Then ARME=ARME-1 : Sam Play 8,1 : TPS_RECHARGE=10 : If GX<PX and PX<GX+11 and GY<PY and PY<GY+11 Then 7000
Goto 667
666
K$=Inkey$
If K$=Chr$(29) Then If GX>5 Then Dec GX
If K$=Chr$(28) Then If GX<305 Then Inc GX
If K$=Chr$(30) Then If GY>43 Then Dec GY
If K$=Chr$(31) Then If GY<240 Then Inc GY
If K$=" " and ARME>0 and TPS_RECHARGE=0 Then ARME=ARME-1 : Sam Play 8,1 : TPS_RECHARGE=10 : If GX<PX and PX<GX+11 and GY<PY and PY<GY+11 Then 7000
Clear Key
667
Bob 9,GX,GY,3 : Bob 11,GX+6,GY+6,4
If TPS_RECHARGE<>0 Then Dec TPS_RECHARGE
Pen 13 : Paper 26
Locate 7,0 : Print TEX3$;ARME;" "
Locate 23,0 : Print TEX4$;TEMPS;" "
If TPS_AFFICHE<>0 Then Dec TPS_AFFICHE : If TPS_AFFICHE=0 Then PXA=3 : PYA=15 : MESSAGE$=String$(" ",36) : Gosub RAPIDE
TEMPS=TEMPS_INIT-Timer/50
If TEMPS<0 Then 9000
Colour 1,0
Update
Goto 777
'
' *** TIR du prisonnier ***
'
TIR_PRISONNIER:
Colour 1,$330
If PY<220 Then 805
If CLEF<>1 and 75<PX and PX<95 Then CLEF=1 : Gosub CLEFS
If CLEF<>2 and 215<PX and PX<235 Then CLEF=2 : Gosub CLEFS
805
If PY>46 Then Return
If CLEF=0 Then PXA=7 : PYA=15 : MESSAGE$=TEX9$ : Gosub RAPIDE : TPS_AFFICHE=10 : Return
If CLEF=1 and 43<PX and PX<63 Then If GRILLE=1 Then VICTOIRE_P=1 Else Gosub GRILLE_AFFICHE
If CLEF=1 and 73<PX and PX<93 Then If GRILLE=2 Then VICTOIRE_P=1 Else Gosub GRILLE_AFFICHE
If CLEF=1 and 103<PX and PX<123 Then If GRILLE=3 Then VICTOIRE_P=1 Else Gosub GRILLE_AFFICHE
If CLEF=2 and 183<PX and PX<203 Then If GRILLE=4 Then VICTOIRE_P=1 Else Gosub GRILLE_AFFICHE
If CLEF=2 and 213<PX and PX<233 Then If GRILLE=5 Then VICTOIRE_P=1 Else Gosub GRILLE_AFFICHE
If CLEF=2 and 243<PX and PX<263 Then If GRILLE=6 Then VICTOIRE_P=1 Else Gosub GRILLE_AFFICHE
Return
GRILLE_AFFICHE:
PXA=7 : PYA=15 : MESSAGE$=TEX5$ : Gosub RAPIDE
TPS_AFFICHE=10
Return
' *** CLEFS ***
CLEFS:
Play 8,30,0
If CLEF=1 Then Bob 7,,,8 : Amal Freeze 7 : Amal On 8
If CLEF=2 Then Bob 8,,,8 : Amal Freeze 8 : Amal On 7
Return
'
' *** Victoire du gardien ***
'
7000
Bob 10,PX-2,PY+5,2
Wait 11
Music Off
Sam Play 3
Update On
Wait 40
Say "ao no !",1
Music 1
Autoback 2
Paper 0
Pen 8
Locate 3,15 : Print String$(" ",36)
Locate 5,15 : Print TEX6$
Autoback 0
Gosub FIN_TIR
Goto 2
'
' *** Victoire du prisonnier ***
'
8000
Autoback 2
Locate 7,0 : Print TEX3$;ARME;" "
Locate 23,0 : Print TEX4$;TEMPS;" "
Paper 0
Pen 8
Locate 3,15 : Print String$(" ",36)
Locate 5,15 : Print TEX7$
Music Off
Sam Play 2
Autoback 0
Update On
If GRILLE=1 Then POS=50
If GRILLE=2 Then POS=80
If GRILLE=3 Then POS=110
If GRILLE=4 Then POS=190
If GRILLE=5 Then POS=220
If GRILLE=6 Then POS=250
Bob Off 10
Bob 23,POS+1,30,32 : Bob 23,POS+1,30,32
For CAR_POS=9 To 13
Bob 24,POS,32,CAR_POS
Wait Vbl
Wait 7
Next CAR_POS
Bob Off 24
Wait Vbl
Music 1
Gosub FIN_TIR
Goto 2
'
' *** Temps ecoule ***
'
9000
Gosub MUSIQUE
Say "It's too late!",1
Music 1
Update On
For NUANCE=0 To $880 Step $110
Colour 0,NUANCE
Wait 3
Next NUANCE
Autoback 2
Paper 0
Pen 12
Locate 3,15 : Print String$(" ",36)
Locate 10,15 : Print TEX8$
Autoback 0
Gosub FIN_TIR
Goto 2
' *** Routine de fin ***
FIN_TIR:
Wait 100
9876
Update On
If Fire(1)=0 and Fire(0)=0 Then Wait 5 : Goto 9876
Fade 5 : Wait 75
Amal Off
Gosub MERCI
Return
'
' *** INITIALISATION ***
'
INIT:
Restore MANETTE
For A=1 To 15 : Read X(A),Y(A) : Next A
Return
MANETTE:
Data 0,-1,0,1,0,0,-1,0,-1,-1,-1,1
Data 0,0,1,0,1,-1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
'
' *** Remplacement d'autoback 2 ***
'
RAPIDE:
Bob Clear
Pen 15 : Paper 0 : Locate PXA,PYA : Print MESSAGE$
Bob Draw
Screen Swap : Wait Vbl
Bob Clear
Pen 15 : Paper 0 : Locate PXA,PYA : Print MESSAGE$
Bob Draw
Screen Swap : Wait Vbl
Return
'
' *** Remerciements ***
'
MERCI:
Screen Open 0,320,256,32,Lowres : Cls 0
Paper 0 : Cls : Curs Off : Flash Off : Hide
Double Buffer
Palette 0,0,0,0
Paper 0
Wait Vbl
Autoback 0
CHANGE=1
C=0 : NL=2
Gosub CR2 : Print "Greetings go this time to ..."
Inc NL
Inc NL
Gosub CR2 : Print "STARSKY ... Ouais je me suis"
Gosub CR2 : Print "d�cid� � revoir un peu ce tr�s"
Gosub CR2 : Print "cher prog du prisonnier."
Inc NL
Gosub CR2 : Print "GIGI ... J'esp�re que tes"
Gosub CR2 : Print "d�buts en programmation"
Gosub CR2 : Print "ne sont pas trop durs !"
Inc NL
Gosub CR2 : Print "BRUNO ... Faudrait que tu te"
Gosub CR2 : Print "remette a l'informatique !"
Gosub CR2 : Print "Ach�te toi donc un vieux 500,"
Gosub CR2 : Print "Thomson is the past !!!"
Inc NL
Gosub CR2 : Print "A oui au fait,je n'ai pas utilis�"
Gosub CR2 : Print "l'AMAL pour la gestion des"
Gosub CR2 : Print "personnages:j'ai programm� juste"
Gosub CR2 : Print "pour le FUN !!!"
Gosub CR2 : Print "De plus ici,c'est inutile,non???"
Gosub CR2 : Print "Ce prog. existait d�j� en basic"
Gosub CR2 : Print "sur 8 bits,et bien que c'�tait"
Gosub CR2 : Print "lent,l'INTERET �tait l� !!!"
Inc NL : Inc NL
Gosub CR2 : Print " A plus ..."
Print : Print : Print : Print : TIR2
Return
'
CR2:
C=C+1 : If C>2 Then C=1
Pen C
Locate 2,NL : NL=NL+1
Return
'
MUSIQUE:
For MVL=62 To 0 Step -2
Mvolume MVL
Wait Vbl
Next MVL
Music Off : Mvolume 63
Return