home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
601-625
/
apd602
/
sky_blitz.amos
/
sky_blitz.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1993-02-25
|
9KB
|
300 lines
Rem====================25/12===5AUTOEXEC_S=========================
Rem ---------------------------screen title-------------------------------
Screen Open 0,320,320,16,Lowres
Curs Off : Hide : Flash Off
Palette 40,$8
Locate 0,7
Centre "****************************"
Cmove ,1 : Centre "* *"
Cmove ,1 : Centre "* SKYBLITZ II *"
Cmove ,1 : Centre "* by *"
Cmove ,1 : Centre "* TOM & KEV *"
Cmove ,1 : Centre "* USING AMOS BASIC *"
Cmove ,1 : Centre "* *"
Cmove ,1 : Centre "* * * * *"
Cmove ,1 : Centre "* thanks to Mr.Unknown *"
Cmove ,1 : Centre "* for original idea *"
Cmove ,1 : Centre "* *"
Cmove ,1 : Centre "****************************"
Wait 150
Rem
Rem------------------------------scroll the title screen-------------------
Rem
Def Scroll 1,0,0 To 630,88,0,6
Def Scroll 2,0,100 To 630,180,0,-6
For X=1 To 16
Scroll 1
Scroll 2
Wait 2
Next X
'
NUT:
Global S
Locate 7,5
Print " PICK JUNIOR OR SENIOR "
Locate 8,7
Print " PRESS J or S "
Wait Key
If Key State(33)=True Then S=False : Bell
If Key State(38)=True Then S=True : Bell
If Key State(33)=False and Key State(38)=False
Boom : Cls : Goto NUT
End If
'
Cls
NUT_2:
Locate 3,5
Print "INSERT YOUR ENTRY LEVEL(1 TO 5)"
Wait Key
If Key State(1)=True Then PICK=1 : Bell
If Key State(2)=True Then PICK=2 : Bell
If Key State(3)=True Then PICK=3 : Bell
If Key State(4)=True Then PICK=4 : Bell
If Key State(5)=True Then PICK=5 : Bell
If PICK<1 or PICK>5 Then Boom : Cls : Goto NUT_2
LEVEL=PICK
'
SCORE=0 : LIVES=3
Dim XBLOCK(50),YBLOCK(50)
Rem-----------------------------**Initalise screen etc.-------------
Double Buffer
Screen Open 1,320,320,16,Lowres
Hide : Curs Off : Flash Off
Rem-----------------------------**Load bank & get sprite palette----
Load "BLITZ.abk"
Get Sprite Palette
Screen Close 0
Rem--------------------Next sheet from here--------------------------
AGAIN:
If LIVES=0
SCORE=0 : LIVES=3
End If
Cls
Rem------------------------Make a green surface area----------------
Ink 25
Bar 0,230 To 320,270
'
If LEVEL=1 Then SCORE=0
Locate 0,1 : Print "SCORE";SCORE
Locate 32,30 : Print "LEVEL";LEVEL
If LEVEL>1 Then Locate 1,30 : Print "LIVES";LIVES
EXTRA=10
Locate 32,1 : Print "EXTRA";EXTRA
'
Rem---------------------- State starting value of variables----------
A=0 : B=1 : C=2 : D=3 : E=4 : J=5 : H=6 : F=20 : K=0 : G=0
L=0 : M=0 : N=0 : O=0 : P=0 : Q=0 : R=0 : X=48 : Y=214 : Z=0
PLANEOFFSCREEN=False : CRASH=False : PLODE=True : WIDTH=16 : HEIGHT=16
BLOCKS=50 : BOMBS=60 : TIP=True
'
Rem-----------------------State global variables
Global MISSILE,PLODE,XBLOCK(),YBLOCK(),BLOCKS,CRASH,WIDTH,HEIGHT,HOLE,TIP
Global LEVEL,BOMBS,EXTRA,DROP,SCORE,LIVES,Z,X,X1,Y,Y1,G,V,T,PLANEOFFSCREEN
'
Rem---------------------- Define positions of the columns of blocks---
Rem----------------------- in random order and paste on screen--------
Rem----------------------- then set zones around them-----------------
Reserve Zone 50
Reset Zone
While Z<50
V=Rnd(6)
If V=A : G=1 : BUILD : Inc L
If L=2 : A=F : End If
End If
If V=B : G=2 : BUILD : Inc M
If M=2 : B=F : End If
End If
If V=C : G=3 : BUILD : Inc N
If N=2 : C=F : End If
End If
If V=D : G=4 : BUILD : Inc O
If O=2 : D=F : End If
End If
If V=E : G=5 : BUILD : Inc P
If P=2 : E=F : End If
End If
If V=J : G=6 : BUILD : Inc Q
If Q=2 : J=F : End If
End If
If V=H : YN=Rnd(1)
If YN=1 : G=8 : BUILD : Inc R
If R=1 : H=F : End If
End If
End If
Procedure BUILD
T=0
Repeat
Inc Z : X1=X : Y1=Y
XBLOCK(Z)=X1 : YBLOCK(Z)=Y1
Paste Bob X,Y,3
Set Zone Z,X1,Y1 To X1+WIDTH-1,Y1+HEIGHT-1
Y=Y-16
Inc T
Until T=G
X=X+16
If X=160 Then X=176
End Proc
Y=214
Wend
'
'
Rem-----------------------Call plane from bank and define flight path
Sprite 0,20,67,1
If S=True Then JUNIOR
If S=False Then SENIOR
Procedure JUNIOR
A$="Loop : For RB=1 To 500; Let X=X+1; Next RB"
If LEVEL=1 Then A$=A$+" Let X=20; Let Y=Y+10;Jump Loop"
If LEVEL=2 Then A$=A$+" Let X=20; Let Y=Y+11;Jump Loop"
If LEVEL=3 Then A$=A$+" Let X=20; Let Y=Y+12;Jump Loop"
If LEVEL=4 Then A$=A$+" Let X=20; Let Y=Y+13;Jump Loop"
If LEVEL=5 Then A$=A$+" Let X=20; Let Y=Y+14;Jump Loop"
If LEVEL>5 Then A$=A$+" Let X=20; Let Y=Y+15;Jump Loop"
If LEVEL>8 Then A$=A$+" Let X=20; Let Y=Y+18;Jump Loop"
If LEVEL>10 Then A$=A$+" Let X=20; Let Y=Y+20;Jump Loop"
If LEVEL>12 Then A$=A$+" Let X=20; Let Y=Y+22;Jump Loop"
Amal 0,A$
Amal On 0
End Proc
'
Procedure SENIOR
A$="Loop : For RB=1 To 250; Let X=X+2; Next RB"
If LEVEL=1 Then A$=A$+" Let X=20; Let Y=Y+8;Jump Loop"
If LEVEL=2 Then A$=A$+" Let X=20; Let Y=Y+9;Jump Loop"
If LEVEL=3 Then A$=A$+" Let X=20; Let Y=Y+10;Jump Loop"
If LEVEL=4 Then A$=A$+" Let X=20; Let Y=Y+11;Jump Loop"
If LEVEL=5 Then A$=A$+" Let X=20; Let Y=Y+12;Jump Loop"
If LEVEL>5 Then A$=A$+" Let X=20; Let Y=Y+14;Jump Loop"
Amal 0,A$
Amal On 0
End Proc
'
Rem---------------------This repeat loop keeps plane moving while testing
Rem----------------------for bomb release,or any collisions by plane or
Rem-----------------------bomb on block or ground, and End of blocks
'
Rem====MAIN LOOP==============MAIN LOOP=============MAIN LOOP============
'
Repeat
If Fire(1)=0 Then F=1 Else F=F+1
If F=2 and TIP=True Then RELEASE
If Y Sprite(6)>=272 and MISSILE=True Then GROUND_BANG
'
CHECK_ZONES
'
If X Sprite(0)>=500 and BLOCKS=0 Then PLANEOFFSCREEN=True
Until CRASH=True or EXTRA=-1 or PLANEOFFSCREEN=True
'
If PLANEOFFSCREEN=True Then DIDIT
'
If EXTRA=-1
Amal Off 6 : Dec LIVES
Locate 0,3 : Centre "YOU HAVE LESS BOMBS THAN BUILDINGS"
End If
'
Rem---------------------SHEET FINISHES WITH THE NEXT LINES-----
'
Wait 150
Sprite Off : Amal Off : Bob Off : MISSILE=False
Goto AGAIN
'
'
Procedure RELEASE
'...................releases bomb and sets counter......
B$="For RC=Y To 272; Let Y=Y+2; Next RC"
Sprite 6,X Sprite(0),Y Sprite(0)+8,2
Amal 6,B$
Amal On 6
TIP=False
MISSILE=True
PLODE=True
EXTRA=BOMBS-BLOCKS
Locate 32,1 : Print "EXTRA";EXTRA
If EXTRA=9 Then Cls 1,312,6 To 320,16 : Rem---blank out the zero on extra
If EXTRA=-1 Then Sprite Off 6
Dec BOMBS
End Proc
'
Procedure GROUND_BANG
'...................bomb has hit the ground (not block)
MISSILE=False
TIP=True
PLODE=True : Rem ...................... counter for explosion
Sprite Off 6
Amal Off 6
Boom
Wait Vbl
Channel 10 To Bob 10
Bob 10,X Sprite(6)-129,Y Sprite(6)-47,6
Amal 10,"Anim 3,(6,2)(7,2);"
Amal On 10
Wait 4
Rem..................make hole in the ground where bomb dropped.......
Bob HOLE,X Bob(10),230,19 : Inc HOLE : Wait Vbl
Bob Off 10
Amal Off 10
Locate 0,1 : Centre " YOU MISSED "
Wait 20
Cls 1,112,4 To 200,20
End Proc
'
Procedure XPLODING
Rem........................animated explosion ..
If PLODE
Channel 11 To Bob 11
Bob 11,X Sprite(6)-129,Y Sprite(6)-37,6
Amal 11,"Anim 1,(6,1)(7,3);"
Amal On 11
Wait 4
Bob Off 11
Amal Off 11
TIP=True
End If
SCORE=SCORE+10*LEVEL
Locate 0,1 : Print "SCORE";SCORE
End Proc
'
Procedure CHECK_ZONES
'.............................. has plane or bomb hit zone ?.......
If Hzone(X Sprite(0)+22,Y Sprite(0))>0 Then PLANE_HIT
If MISSILE
If Hzone(X Sprite(6),Y Sprite(6)-3)>0
T=Hzone(X Sprite(6),Y Sprite(6)-3)
Boom : Amal Off 6 : Sprite Off 6
Z=T
Paste Bob XBLOCK(Z),YBLOCK(Z),9
Reset Zone T : Dec BLOCKS
XPLODING
End If
End If
End Proc
'
Procedure PLANE_HIT
Boom : Amal Off : Sprite Off
Channel 14 To Bob 14
Bob 14,X Sprite(0)-115,Y Sprite(0)-45,4
Amal 14,"Anim 1,(4,2)(5,2)(6,2)(7,2)(11,4)(14,6);"
Amal On 14
Wait 18
Amal Off 14
Bob Off
Wait Vbl
Cls
CRASH=True
Dec LIVES
If LIVES=0 Then LEVEL=1
Locate 0,3 : Centre "I THINK YOU BUMPED INTO A BUILDING"
End Proc
Rem--------------------------Increase levels
'
Procedure DIDIT
Sprite Off : Bob Off : Amal Off
Bar 0,230 To 320,240
If LEVEL=1 Then Locate 0,3 : Centre "O.K. BUT WHAT ABOUT THE NEXT ONE"
If LEVEL=2 Then Locate 0,3 : Centre "GOOD, BUT THE NEXT ONE'S HARDER"
If LEVEL=3 Then Locate 0,3 : Centre "WOW -----YOU ARE BUZZING NOW "
If LEVEL=4 Then Locate 0,3 : Centre "IF YOU THINK THAT ONE WAS HARD"
If LEVEL>4 Then Locate 0,3 : Centre "YOU HAVE EARNED AN EXTRA LIFE"
Inc LEVEL
If LEVEL>5 Then Inc LIVES
End Proc