home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
551-575
/
apd558
/
amoner1
/
fortron.amos
/
fortron.amosSourceCode
Wrap
AMOS Source Code
|
1993-11-29
|
7KB
|
281 lines
Load "fortron.bank"
Hide
Set Rainbow 2,0,300,"(150,0,1)(10,1,0)","(10,0,1)(20,1,0)","(20,1,0)"
Set Rainbow 1,0,300,"(20,1,15)","(7,0,1)(20,1,15)","(14,0,1)(20,1,15)"
Screen Close 0
Randomize Timer
Do
TITLES
'COMPETITION
TRON[$F22,$2F2]
'SCORE=Rnd(7) : SCORE1=Rnd(7)
SCORESHOW["Red","Green",SCORE,SCORE1]
Loop
'
'
Procedure TRON[CLR1,CLR2]
II=0 : II1=0
Shared SCORE,SCORE1
Dim DX(4),DY(4)
For I=1 To 4 : Read DX(I),DY(I) : Next
Data 0,-1,0,1,-1,0,1,0
SCORE=0 : SCORE1=0
GAME:
Screen Open 2,960,600,4,LORES
Screen Hide 2
Flash Off
Cls 4
For A=0 To 960 Step 30
Ink 1
Draw A,0 To A,600
Next
For A=0 To 600 Step 30
Draw 0,A To 960,A
Next
Ink 2
Bar 0,0 To 960,10
Bar 0,590 To 960,600
Bar 0,0 To 10,600
Bar 950,0 To 960,600
Unpack 6 To 1
Palette $A,$25A,CLR1,CLR2
Colour Back $A
Gosub SCOREUP
Wait 40
Ink 0
Bar 10,10 To 150,150
Bar 170,10 To 310,150
Screen 1
Double Buffer
Flash Off : Curs Off
Gosub SCOREUP
Autoback 0
DR=Rnd(3)+1 : DR1=Rnd(3)+1
Repeat
X=Rnd(250)+425 : Y=Rnd(100)+250 : X1=Rnd(250)+425 : Y1=Rnd(100)+250
Until(Abs(X-X1)>60) and(Abs(Y-Y1)>60)
SPD=5 : SPD1=5 : II=30 : II1=30
ITER:
DEAD=0
If Jdown(1) and DR<>1 Then DR=2 : Goto P1
If Jup(1) and DR<>2 Then DR=1 : Goto P1
If Jleft(1) and DR<>4 Then DR=3 : Goto P1
If Jright(1) and DR<>3 Then DR=4
P1:
If(Fire(1)) and(SPD<7) Then Inc SPD
If(Fire(0)) and(SPD1<7) Then Inc SPD1
If(Fire(1)=0) Then SPD=5
If(Fire(0)=0) Then SPD1=5
If Jdown(0) and DR1<>1 Then DR1=2 : Goto P2
If Jup(0) and DR1<>2 Then DR1=1 : Goto P2
If Jleft(0) and DR1<>4 Then DR1=3 : Goto P2
If Jright(0) and DR1<>3 Then DR1=4
P2:
'
D2=(X-X1)*(X-X1)+(Y-Y1)*(Y-Y1)
Volume %1010,Min(63,30000/D2)
' as == approach speed
XX=X-X1+DX(DR)-DX(DR1)
YY=Y-Y1+DY(DR)-DY(DR1)
_AS=Sqr((XX*XX+YY*YY)*200)
_AS=_AS-Sqr(D2*200)
Volume %101,20
Sam Raw %1,Start(10),Length(10),1000+II*20
Sam Raw %100,Start(10),Length(10),1200+II1*20
Sam Raw %1000,Start(10),Length(10),1200+II1*20-_AS*8
Sam Raw %10,Start(10),Length(10),1000+II*20-_AS*8
If SPD*10>II Then Inc II Else If SPD*10<II Then Add II,-4
If SPD1*10>II1 Then Inc II1 Else If SPD1*10<II1 Then Add II1,-4
Screen 2
Ink 2
If DR=1 Then Goto U1
If DR=2 Then Goto D1
If DR=3 Then Goto L1
If DR=4 Then Goto R1
NXT:
Ink 3
If DR1=1 Then Goto U2
If DR1=2 Then Goto D2
If DR1=3 Then Goto L2
If DR1=4 Then Goto R2
NXT1:
H=X : V=Y : H1=X1 : V1=Y1
If H<71 Then H=71
If V<71 Then V=71
If H1<71 Then H1=71
If V1<71 Then V1=71
If H>888 Then H=888
If H1>888 Then H1=888
If V>528 Then V=528
If V1>528 Then V1=528
Get Block 1,H-71,V-71,143,143
Get Block 2,H1-71,V1-71,143,143
Screen 1
Put Block 1,10,10
Put Block 2,170,10
Screen Swap
Wait Vbl
If DEAD>0 Then Goto TEST
Goto ITER
DEAD:
End
U1:
Y=Y-SPD
If Point(X,Y)>1 or Point(X,Y+2)>1 Then DEAD=DEAD+1
If(SPD=7) and(Rnd(20)=0) Then Goto NXT
Bar X-2,Y To X+2,Y+SPD
Goto NXT
D1:
Y=Y+SPD
If Point(X,Y)>1 or Point(X,Y-2)>1 Then DEAD=DEAD+1
If(SPD=7) and(Rnd(20)=0) Then Goto NXT
Bar X-2,Y-SPD To X+2,Y : Goto NXT
Goto NXT
L1:
X=X-SPD
If Point(X,Y)>1 or Point(X+2,Y)>1 Then DEAD=DEAD+1
If(SPD=7) and(Rnd(20)=0) Then Goto NXT
Bar X,Y-2 To X+SPD,Y+2 : Goto NXT
Goto NXT
R1:
X=X+SPD
If Point(X,Y)>1 or Point(X-2,Y)>1 Then DEAD=DEAD+1
If(SPD=7) and(Rnd(20)=0) Then Goto NXT
Bar X-SPD,Y-2 To X,Y+2
Goto NXT
U2:
Y1=Y1-SPD1
If Point(X1,Y1)>1 or Point(X1,Y1+2)>1 Then DEAD=DEAD+2
If(SPD1=7) and(Rnd(20)=0) Then Goto NXT1
Bar X1-2,Y1 To X1+2,Y1+SPD1
Goto NXT1
D2:
Y1=Y1+SPD1
If Point(X1,Y1)>1 or Point(X1,Y1-2)>1 Then DEAD=DEAD+2
If(SPD1=7) and(Rnd(20)=0) Then Goto NXT1
Bar X1-2,Y1-SPD1 To X1+2,Y1
Goto NXT1
L2:
X1=X1-SPD1
If Point(X1,Y1)>1 or Point(X1+2,Y1)>1 Then DEAD=DEAD+2
If(SPD1=7) and(Rnd(20)=0) Then Goto NXT1
Bar X1,Y1-2 To X1+SPD1,Y1+2
Goto NXT1
R2:
X1=X1+SPD1
If Point(X1,Y1)>1 or Point(X1-2,Y1)>1 Then DEAD=DEAD+2
If(SPD1=7) and(Rnd(20)=0) Then Goto NXT1
Bar X1-SPD1,Y1-2 To X1,Y1+2
Goto NXT1
TEST:
If DEAD=1 Then SCORE1=SCORE1+1
If DEAD=2 Then SCORE=SCORE+1
Boom
Gosub SCOREUP
Wait 50
If SCORE>6 or SCORE1>6 Then Goto FINITO
Goto GAME
SCOREUP:
Pen 1 : Paper 0
Locate 13,22 : Print SCORE
Locate 33,22 : Print SCORE1
Return
FINITO:
Screen Close 1
Screen Close 2
Colour Back 0
End Proc
Procedure SCORESHOW[P1$,P2$,S1,S2]
Dim CR$(7)
Bank Swap 3,4
Music 1
Screen Open 1,320,200,2,Lowres
Cls 0
Curs Off
Palette 0,$FFF
Rainbow 1,0,20,300
'
Print : Print : Print : Print
Centre "Scores for previous round:" : Print : Print
For I=0 To 7 : Read CR$(I) : Next
Centre P2$+" "+CR$(S1)+"," : Print : Print
Centre P1$+" "+CR$(S2)+"." : Print : Print : Print : Print
If S1>S2
Centre P1$+" wins this round."
Else
Centre P2$+" wins this round."
End If
'
Clear Key
Wait Key
Screen Close 1
Music Off
Bank Swap 3,4
Rainbow 1,0,0,0
Data "never crashed","crashed once","crashed twice","crashed 3 times"
Data "crashed 4 times","crashed 5 times","crashed 6 times","crashed 7 times"
End Proc
Procedure TITLES
Set Rainbow 2,0,300,"(150,0,1)(10,1,0)","(10,0,1)(20,1,0)","(20,1,0)"
Rainbow 2,0,40,300
Music 1
Unpack 7 To 1
Flash 1,"(fff,1)(222,2)"
Get Bob 1,1,0,127 To 283,166
Get Bob 1,2,0,167 To 283,209
Bar 0,0 To 11,6
Get Bob 1,3,0,0 To 5,2
Get Bob 1,4,0,0 To 10,5
Ink 0
Bar 0,0 To 11,6
Bar 0,127 To 283,209
Double Buffer
Degree
While A$="" : A$=Inkey$
I#=I#+4.0
X1=Cos(I#*2.0)*20+Sin(I#*0.5)*50-70
X2=Sin(I#*0.4)*50+Cos(I#)*20-70
Bob 12,X1,150,1
Bob 13,X2,155,2
Add I1,-10,0 To 320 : Bob 1,I1,155,3
Add I2,-12,0 To 320 : Bob 2,I2,165,3
Add I3,-35,0 To 320 : Bob 3,I3,190,4
'
Wait Vbl
Wend
If A$=Chr$(27)
Default
Run "Start.Amos"
End If
Screen Close 1
Rainbow 2,0,0,0
Music Off
End Proc
Procedure COMPETITION
Dim F$(8)
Screen Open 1,320,200,16,Lowres
Paper 0 : Pen 1
Cls
Palette 0,$FFF,$FF,$FF0,$F00,$F0,$33F,$0,$FFF,$FF0,$F0F,$FF
Rainbow 1,0,20,300
Centre "Enter the names of the players," : Print : Print
Centre "Press return on a blank line to finish" : Print : Print
I=0
Repeat
Pen I+4
Input F$(I)
Inc I
Until(I>8) or(F$="")
Cls
Pen 1
Print "Do you want to play a "
Print Paper$(6);"R";Paper$(0);"ound robin, or"
Print Paper$(6);"E";Paper$(0);"limination ?"
Repeat
I$=Inkey$
Until(I$="r") or(I$="e")
If I$="r"
GAMES=I*(I-1)-I
End If
Screen Close 1
End Proc