TGC Codebase Backup



Copter Blitz (Fun Game) by Nigel _Okgo

31st May 2005 18:06
Summary

A Fun Classic Helicopter Game, similair to some of the Classic Versions featured on the Original Amstrad Cpc, very Simple....



Description

Similair to the Classic Blitz Game, Originally featured on such
Computers as the Amstrad, or Commodore 64.... A Fun Game, with about 8 Levels and 2 different Graphics Modes to Select, Random Buildings, Lots of Classic Midi Music and Graphics, and Difficult settings on the Options Screen.... Email :- Michaelstephenrt@Hotmail.com



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    randomize timer()
dim bx(800)
dim sprx(50)
dim spry(50)
dim spri(50)
dim sprii(50)
dim stx(100)
dim sty(100)
dim sti(100)
dim carx(10)
dim cary(10)
dim cari(10)
dim carii(10)
dim carhit(10)
dim subx(10)
dim suby(10)
dim subi(10)
dim subii(10)
dim flx(20)
dim fly(20)
dim fli(20)
dim flii(20)
dim flsp1(20)
dim flsp2(20)
dim flspr(20)
dim flcrash(20)
dim fltmr(20)
setup:
delete static objects
autocam off
set emulation off
sync on
sync rate 256
draw to back
backdrop off
for t=1 to 250
cls rgb(0,0,196)
ink rgb(255,255,0),rgb(255,255,0)
text 220,200,"****Welcome to Copter Blitz****"
sync
sync
next t
sync
sync
hide mouse
load image "title.bmp",11
load image "tree.bmp",12
load image "bush.bmp",13
load image "hill.bmp",14
load image "cloud.bmp",15
load image "waves.bmp",16
load image "plane.bmp",1
load image "bomb.bmp",3
load image "explode.bmp",4
load image "plane1.bmp",5
load image "plane2.bmp",6
load image "plane3.bmp",7
load image "plane4.bmp",8
load image "buildings1.bmp",17
load image "buildings2.bmp",18
load image "buildings3.bmp",19
load image "buildings4.bmp",20
load image "buildings5.bmp",21
load image "plane1.bmp",22
load image "plane2.bmp",23
load image "plane3.bmp",24
load image "plane4.bmp",25
load image "helicopter1.bmp",26
load image "helicopter2.bmp",27
load image "helicopter3.bmp",28
load image "helicopter4.bmp",29
load image "car1.bmp",30
load image "car2.bmp",31
load image "car3.bmp",32
load image "car4.bmp",33
load image "car5.bmp",34
load image "iconx1.bmp",35
load image "iconx2.bmp",36
load image "iconx3.bmp",37
load image "iconx4.bmp",38
load image "iconx5.bmp",39
load image "iconx6.bmp",40
load image "iconx7.bmp",41
load image "iconx8.bmp",42
load image "iconx9.bmp",43
load image "alien1.bmp",44
load image "alien2.bmp",45
load image "hit.bmp",46
load image "submarine.bmp",10
sync
sync
sync
sync
sync
sync
sync
sync
set1=0
set2=1
music=1
for t=1 to 10
flx(t)=rnd(600)
fly(t)=rnd(300)
fli(t)=rnd(1)
flii(t)=rnd(1)
flsp1(t)=2+rnd(3)
flsp2(t)=2+rnd(3)
flspr(t)=44
flcrash(t)=0
fltmr(t)=0
next t
flygo=0
if rnd(5)=0 then flygo=1
flyamount=rnd(10)+1
goto start
snd:
if set2=0 then load sound "hit1.wav",1
if set2=1 then load sound "hit2.wav",1
if set2=0 and level<5 then load sound "explode4.wav",2
if set2=0 and level>4 then load sound "explode3.wav",2
if set2=1 and level<5 then load sound "explode1.wav",2
if set2=1 and level>4 then load sound "explode2.wav",2
load sound "explode2.wav",5
return
sndx:
stop music 1
if set2=0 then play sound 2
if set2=1 then play sound 5
set sound speed 2,5000
return
start:
load sound "select1.wav",4
gosub snd
level=0
scrx=0
scrxx=0
tmr=0
dim scx(50)
dim scy(50)
dim sci(50)
dim spr(50)
for t=1 to 50
scx(t)=-100
next t
x=264
y=68
key=2
cl=0
bx=-200:by=480
sndok=0
sp2=4
yy=0
tmrgo=0
tmrgox=0
bxx=1
scrgo=1
bgo=0
oktr=0
level=0
for t=22 to 25
spri(t)=rnd(1)
sprii(t)=rnd(1)
sprx(t)=0
spry(t)=0
next t
crash=0
keygo=0
gosub music
allow=0
plspr=26
pltmr=0
for t=1 to 10
carx(t)=rnd(2560)
cary(t)=428
cari(t)=-1+rnd(2)
carii(t)=1
carhit(t)=0
next t
for t=1 to 10
subx(t)=rnd(2560)
suby(t)=428
subi(t)=rnd(1)
subii(t)=rnd(1)
next t
carxx=2560:cary=428
subxx=2560:suby=428
start1:
s=x:d=y
scrx=scrx-scrgo
if scrgo=1 then tmr=tmr+1:if tmr=2 then tmr=0:scrxx=scrxx-1
if scrgo=2 then scrxx=scrxx-1
if scrx<-640 then scrx=0
if scrxx<-640 then scrxx=0
if set2=0 then cl=0
if set2=1 then cl=1
if cl=0 then paste image 11,scrxx,0,0
if cl=0 then paste image 11,scrxx+640,0,0
if cl=1 then cls rgb(128,196,255)
for t=1 to 50
i=rnd(2500)
if i=0 and scx(t)=-100 then goto scenery
goto sceneryx
scenery:
spr(t)=12+rnd(4)
build=20
if set1=1 then build=17
if set1=2 then build=21
if set1=3 then build=17+rnd(4)
if set1=0 then if rnd(2)=0 then spr(t)=build
if set1=1 then if rnd(2)=0 then spr(t)=build
if set1=2 then if rnd(1)=0 then spr(t)=build
if set1=3 then spr(t)=build
if spr(t)=12 and rnd(1)=0 then scx(t)=640:scy(t)=372
if spr(t)=13 and rnd(1)=0 then scx(t)=640:scy(t)=432
if spr(t)=14 and rnd(1)=0 then scx(t)=640:scy(t)=426
if spr(t)=15 and rnd(2)=0 then scx(t)=640:scy(t)=rnd(350)
ok=0
if spr(t)>16 then scx(t)=640:ok=1
if ok=1 then if set1=0 then scy(t)=300+rnd(100)
if ok=1 then if set1=1 then scy(t)=250+rnd(150)
if ok=1 then if set1=2 then scy(t)=200+rnd(100)
if ok=1 then if set1=3 then scy(t)=200+rnd(200)
sceneryx:
next t
if oktr=1 then if allow<500 then allow=allow+1
for t=1 to 50
if scx(t)>-100 then scx(t)=scx(t)-scrgo
if scx(t)<-100 then scx(t)=-100
if spr(t)>16 then goto build1
goto after
build1:
for ty=480 to scy(t) step -12
paste image spr(t),scx(t),ty,0
next ty
if scx(t)>-50 and scx(t)<-45 then if scy(t)<440 then if oktr=1 and allow=500 then yy=yy+sp2
ok=0
if bx>scx(t)-24 and bx<scx(t)+4 and by<480 then if by>scy(t) then if scy(t)<484 then scy(t)=scy(t)+sp2*2:sndok=sndok+1:ok=1
if x>scx(t)-64 and x<scx(t)-56 then if y>scy(t)-20 then if crash=0 then crash=1:gosub sndx
if ok=1 then paste image 4,(scx(t)-12)+rnd(24),scy(t)-rnd(24)+rnd(24),0
if ok=1 then if sndok=1 then play sound 2
goto afterx
after:
if scx(t)>-100 then paste image spr(t),scx(t),scy(t),0
afterx:
next t
gosub cars
goto carx
cars:
for t=1 to 5
if carhit(t)>0 then goto carsxx
carx(t)=carx(t)+cari(t)
if carx(t)<-50 then carx(t)=carxx:cari(t)=-1+rnd(2)
if carx(t)>carxx then carx(t)=-50:cari(t)=1+rnd(2)
if cari(t)=0 then cari(t)=1+rnd(2)
if cary(t)<cary-10 then carii(t)=1
if cary(t)>cary+10 then carii(t)=0
if carii(t)=0 then cary(t)=cary(t)-1
if carii(t)=1 then cary(t)=cary(t)+1
if bx>carx(t)-24 and bx<carx(t)+80 and by>cary(t)-24 and by<cary(t)+24 and carhit(t)=0 then carhit(t)=1:play sound 2:gosub cari
goto carii
cari:
cari(t)=-1+rnd(2)
carii(t)=4
return
carii:
carsxx:
sprite t,carx(t),cary(t),29+t
if carhit(t)>0 and carhit(t)<100 then carhit(t)=carhit(t)+1
if carhit(t)>0 and carhit(t)<100 then for tt=0 to 8:sprite t*10+tt,(carx(t)-20)+rnd(128),(cary(t)-40)+rnd(84),4:next tt
if carhit(t)>0 and carhit(t)<100 then scale sprite t,100-(carhit(t)/4)
if carhit(t)>0 and carhit(t)<100 then for tt=0 to 8:scale sprite t*10+tt,100-(carhit(t)/4):next tt
if carhit(t)>0 and carhit(t)<50 then carx(t)=carx(t)+cari(t):carii(t)=carii(t)+1:cary(t)=cary(t)-carii(t)/4
if carhit(t)>49 and carhit(t)<100 then carx(t)=carx(t)+cari(t):carii(t)=carii(t)-4:cary(t)=cary(t)-carii(t)/4
if carhit(t)=1 then flip sprite t:mirror sprite t
if carhit(t)=50 then flip sprite t:mirror sprite t
if carhit(t)=99 then flip sprite t:mirror sprite t
if carhit(t)=100 then gosub afterok
goto afterokgo
afterok:
for tt=0 to 8
if sprite exist(t*10+tt)=1 then delete sprite t*10+tt
next tt
delete sprite t
return
afterokgo:
next t
return
carx:
for tx=scrx to scrx+1280 step 32
if tx>-32 and tx<672 then paste image 16,tx,464,0
next tx
if cl=0 then if crash=0 then paste image 1,x,y,0
if cl=1 then if crash=0 then gosub pl
set text font "westminster"
set text size 28
ink rgb(255,255,0),rgb(255,255,0)
set text to bold
if oktr=0 then text 178,128,"****COPTER BLITZ****"
ink rgb(255,255,255),rgb(255,255,255)
if oktr=0 then text 179,127,"****COPTER BLITZ****"
set text to normal
set text size 24
ink rgb(255,255,0),rgb(255,255,0)
if oktr=0 then text 178,180,"(1) Start Game"
bxx=0
if set1=0 then scrgo=1:bxx=1:tmrgox=2:sp2=7:xsp=4:ysp=4:a$="Easy"
if set1=1 then scrgo=1:bxx=2:tmrgox=0:sp2=5:xsp=5:ysp=5:a$="Average"
if set1=2 then scrgo=2:bxx=5:tmrgox=0:sp2=20:xsp=8:ysp=8:a$="Hard"
if set1=3 then scrgo=1:bxx=1:tmrgox=0:sp2=8:xsp=4:ysp=4:a$="Random"
if oktr=0 then text 178,220,"(2) Difficulty :- "+a$
if set2=0 then a$="Arcade"
if set2=1 then a$="Classic"
if oktr=0 then text 178,260,"(3) Graphics :- "+a$
if music=0 then a$="Off"
if music=1 then a$="On"
if oktr=0 then text 178,300,"(4) Music :- "+a$
paste image 35,314,164,0
if set1=0 then paste image 36,351,209,0
if set1=1 then paste image 37,395,209,0
if set1=2 then paste image 38,365,210,0
if set1=3 then paste image 39,395,210,0
if set2=0 then paste image 40,400,250,0
if set2=1 then paste image 41,400,250,0
if music=0 then paste image 42,325,285,0
if music=1 then paste image 43,330,290,0
if leftkey()=1 and x>0 then if crash=0 then x=x-xsp
if rightkey()=1 and x<550 then if crash=0 then x=x+xsp
if upkey()=1 then if crash=0 then y=y-ysp
if y<yy and upkey()=1 then if oktr=1 then if crash=0 then y=y+sp2+1
if y<yy and upkey()=0 then if oktr=1 then if crash=0 then y=y+1
if crash=0 then if crash=0 then if y>410 then gosub sndx:crash=1
if crash=1 then y=y+1
if downkey()=1 then if crash=0 then y=y+ysp
if scancode()=0 then if key<2 then key=key+1
if inkey$()="1" and key=2 then key=0:stop music 1:load sound "select4.wav",4:play sound 4:goto startokgo
ok=0
if inkey$()="2" and key=2 then ok=1:key=0:set1=set1+1:if set1=4 then set1=0
if ok=1 then gosub music
if ok=1 then load sound "select2.wav",4:play sound 4
ok=0
if inkey$()="3" and key=2 then ok=1:key=0:set2=set2+1:if set2=2 then set2=0
if ok=1 then gosub snd:load sound "select1.wav",4:play sound 4
ok=0
if inkey$()="4" and key=2 then ok=1:key=0:music=music+1:if music=2 then music=0
if ok=1 then load sound "select3.wav",4:play sound 4
if ok=1 then if music=0 then stop music 1
if ok=1 then if music=1 then loop music 1
ok=0
if s=x and d=y and keystate(57)=1 then if bgo<500 then bgo=bgo+1
okgox=0
if s<>x or d<>y then bgo=0:okgox=1
if okgox=1 then if oktr=0 then oktr=1
if bgo=500 and key=2 and keystate(57)=1 then if crash=0 then key=0:play sound 4
if bgo=500 then ok=1
if keystate(57)=1 and okgo=1 then if crash=0 then if ok=0 then okgo=0:bx=x+32:by=y+20:sndok=0:play sound 1
ok=0
if crash=1 then bx=-100
if by<484 then ok=1:by=by+sp2:paste image 3,bx,by,0
if flygo=1 then gosub fly
goto flgox
fly:
for t=1 to flyamount
if fltmr(t)=200 then goto flgoxx
if bx>flx(t)-28 and bx<flx(t)+28 and by>fly(t)-8 and by<fly(t)+8 then if flcrash(t)=0 then flcrash(t)=1:flii(t)=rnd(1):flsp2(t)=2+rnd(3):fltmr(t)=1
if fly(t)>450 then goto flgo
if flcrash(t)=1 then fli(t)=1:flsp1(t)=5
if fli(t)=0 then fly(t)=fly(t)-flsp1(t)
if fli(t)=1 then fly(t)=fly(t)+flsp1(t)
if flii(t)=0 then flx(t)=flx(t)-flsp2(t)
if flii(t)=1 then flx(t)=flx(t)+flsp2(t)
if flx(t)<-50 then flx(t)=-50:flii(t)=1
if flx(t)>700 then flx(t)=700:flii(t)=0
if fly(t)<-50 then fly(t)=-50:fli(t)=1
if fly(t)>300 and flcrash(t)=0 then fly(t)=300:fli(t)=0
if rnd(50)=0 or fli(t)=0 and flii(t)=0 then if flcrash(t)=0 then fli(t)=rnd(2):flii(t)=rnd(2):flsp1(t)=2+rnd(3):flsp2(t)=2+rnd(3)
flgo:
if flcrash(t)=0 then flspr(t)=44
if flcrash(t)=1 then flspr(t)=45
paste image flspr(t),flx(t),fly(t),0
if fltmr(t)>0 and fltmr(t)<200 then fltmr(t)=fltmr(t)+1
ink rgb(255,255,255),rgb(255,255,255)
if fltmr(t)=150 then play sound 2
if fltmr(t)>150 then for tt=1 to 4:paste image 46,(flx(t)+4)+rnd(24),(704-fltmr(t)*2)+rnd(50),0:next tt
for tx=40 to 560 step 40
if flcrash(t)=1 then if flx(t)>tx-24 and flx(t)<tx+24 and fly(t)>bx(tx)-24 then if bx(tx)<484 then bx(tx)=bx(tx)+sp2:play sound 2
next tx
flgoxx:
next t
return
flgox:
if crash=1 then goto crashx
goto crashxx
crashx:
for t=22 to 25
sprx(t)=sprx(t)+spri(t)
spry(t)=spry(t)+sprii(t)
if cl=0 then paste image t,x+sprx(t),y+spry(t),0
next t
if cl=0 then if y<400 then x=x+1:y=y+2
if cl=1 then y=y+4:if y>440 then y=440
if cl=1 then if keygo<50 then x=x+2
if cl=1 then if keygo>49 then scrgo=0
if cl=1 then paste image 29,x-12,y-32,0
if cl=1 then if y=440 then if keygo<200 then keygo=keygo+1
if cl=0 then if y>480 then keygo=1
if cl=0 then if scancode()=0 and keygo=1 then goto start
if cl=1 then if scancode()=0 and keygo=200 then goto start
crashxx:
if ok=1 then tmrgo=tmrgo+1:if tmrgo>tmrgox then tmrgo=0
if ok=1 then if tmrgo=0 then bx=bx+bxx
if by>480 then okgo=1
sync
goto start1
pl:
pltmr=pltmr+1:if pltmr=5 then pltmr=0:plspr=plspr+1
if plspr=28 then plspr=26
paste image plspr,x-12,y-32,0
return
music:
if music=0 then goto musicx
song=set1+1
if song=1 then load music "music/frogger1.mid",1:loop music 1
if song=2 then load music "music/frogger2.mid",1:loop music 1
if song=3 then load music "music/title.mid",1:loop music 1
if song=4 then load music "music/complete2.mid",1:loop music 1
musicx:
return
startokgo:
cls rgb(0,0,0)
for t=1 to 100
if sprite exist(t)=1 then scale sprite t,100:delete sprite t:sync
next t
carxx=640
for t=1 to 10
carx(t)=rnd(640)
cari(t)=1+rnd(2)
carii(t)=rnd(1)
carhit(t)=0
next t
subxx=640
for t=1 to 10
subx(t)=rnd(640)
subi(t)=rnd(1)
subii(t)=rnd(1)
next t
for t=1 to 10
flx(t)=rnd(600)
fly(t)=rnd(300)
fli(t)=rnd(1)
flii(t)=rnd(1)
flsp1(t)=2+rnd(3)
flsp2(t)=2+rnd(3)
flspr(t)=44
flcrash(t)=0
fltmr(t)=0
next t
flygo=0
if rnd(5)=0 then flygo=1
flyamount=rnd(10)+1
sync
sync
level=level+1
if level=9 then load image "other.bmp",11:goto complete1
load image "background1.bmp",9
str1=100:str2=50
if level=2 and cl=1 then load image "scenery1.bmp",9
if level=3 and cl=0 then load image "background2.bmp",9
if level=3 and cl=1 then load image "scenery2.bmp",9
if level=4 then load image "background3.bmp",9
if level=5 and cl=0 then load image "background4.bmp",9
if level=5 and cl=1 then load image "scenery3.bmp",9
if level=6 and cl=0 then load image "background5.bmp",9
if level=6 and cl=1 then load image "buildings.bmp",9
if level=7 and cl=0 then load image "Complete.bmp",9
if level=7 and cl=1 then load image "scenery4.bmp",9
if level=8 and cl=1 then load image "scenery5.bmp",9
if level=1 or level=2 then load image "buildings1.bmp",2
if level=3 then load image "buildings2.bmp",2
if level=4 then load image "buildings3.bmp",2
if level=5 then load image "buildings4.bmp",2
if level=6 then load image "buildings5.bmp",2
if level=7 then load image "buildings4.bmp",2
if level=8 then load image "buildings4.bmp",2
spgo=40
if level=1 or level=2 then lvl1=250:lvl2=150:sp1=2.50:sp2=4
if level=3 or level=4 then lvl1=200:lvl2=200:sp1=2.50:sp2=4
if level=5 or level=6 then lvl1=200:lvl2=150:sp1=2.50:sp2=4
if level=7 then lvl1=150:lvl2=200:sp1=4:sp2=8:spgo=20
if level=8 then lvl1=150:lvl2=100:sp1=4:sp2=8:spgo=20
if set1=0 then lvl1=lvl1+50:lvl2=lvl2+50:sp1=sp1-0.50:sp2=sp2*1.50
if set1=2 then sp1=sp1*1.50:sp2=sp2*1.50
gosub snd
if level=1 then load music "music/level1.mid",1
if level=2 then load music "music/level2.mid",1
if level=3 then load music "music/level3.mid",1
if level=4 then load music "music/level4.mid",1
if level=5 then load music "music/frogger1.mid",1
if level=6 then load music "music/frogger2.mid",1
if level=7 then load music "music/complete2.mid",1
if level=8 then load music "music/title.mid",1
load music "music/complete1.mid",2
play music 1
x=-200:y=0
sync on
sync rate 0
for tx=0 to 600 step 20
bx(tx)=lvl1+rnd(lvl2)
next tx
color backdrop rgb(0,0,0)
bx=-200:by=480
sndok=0
okgo=0
for t=1 to 100
stx(t)=rnd(640)
sty(t)=rnd(480)
sti(t)=2+rnd(2)
next t
sny=480
tmr=0
tmrgo=0
tmrx=0
tmrxx=0
str1=0
str2=0
for t=1 to 10
scx(t)=-40+rnd(680)
spr(t)=12+rnd(2)
next t
for t=11 to 20
scx(t)=-40+rnd(680)
scy(t)=rnd(350)
sci(t)=rnd(1)+1
next t
sync
sync
1:
if level=1 then gosub lvl1:goto lvlx
if level=2 then gosub lvl2:goto lvlx
if level=3 then gosub lvl3:goto lvlx
if level=4 then gosub lvl4:goto lvlx
if level=5 then gosub lvl5:goto lvlx
if level=6 then gosub lvl6:goto lvlx
if level=7 then gosub lvl7:goto lvlx
if level=8 then gosub lvl8:goto lvlx
lvl1:
if cl=0 then cls rgb(0,0,0)
if cl=1 then cls rgb(128,196,255)
ink rgb(255,255,255),rgb(255,255,255)
if cl=0 then str1=100:str2=50
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
if cl=0 then goto lvl1x
for t=1 to 8
spr=spr(t)
if spr=12 then paste image 12,scx(t),372,0
if spr=13 then paste image 13,scx(t),432,0
if spr=14 then paste image 14,scx(t),426,0
next t
for t=11 to 14
scx(t)=scx(t)-sci(t)
if scx(t)<-50 then scx(t)=640:scy(t)=rnd(350):sci(t)=1+rnd(1)
paste image 15,scx(t),scy(t),0
next t
lvl1x:
return
lvl2:
if cl=0 then cls rgb(0,0,0)
if cl=1 then cls rgb(128,196,255)
ink rgb(255,255,255),rgb(255,255,255)
if cl=0 then str1=100:str2=0
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
if cl=0 then paste image 9,0,438,0
if cl=1 then paste image 9,0,0,0
return
lvl3:
cls rgb(0,0,0)
ink rgb(255,255,255),rgb(255,255,255)
if cl=0 then str1=100:str2=50
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
if cl=0 then paste image 9,0,268,0
if cl=1 then paste image 9,0,0,0
return
lvl4:
cls rgb(0,0,0)
ink rgb(255,255,255),rgb(255,255,255)
if cl=0 then str1=50:str2=25
if cl=1 then str1=50
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
paste image 9,0,228,0
return
lvl5:
if cl=0 then cls rgb(0,0,0)
ink rgb(255,255,255),rgb(255,255,255)
if cl=0 then str1=50:str2=25
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
if cl=0 then paste image 9,0,284,0
if cl=0 then goto lvl5x
paste image 9,0,0,0
lvl5x:
return
lvl6:
if cl=0 then cls rgb(0,0,0)
ink rgb(255,255,255),rgb(255,255,255)
if cl=0 then str1=100:str2=50
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
if cl=0 then paste image 9,0,350,0
if cl=1 then paste image 9,0,0,0
return
lvl7:
if cl=0 then cls rgb(0,0,0)
ink rgb(255,255,255),rgb(255,255,255)
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
paste image 9,0,0,0
return
lvl8:
if cl=0 then cls rgb(0,0,0)
ink rgb(255,255,255),rgb(255,255,255)
if cl=0 then str1=50:str2=25
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
if cl=1 then paste image 9,0,0,0
return
lvlx:
for t=1 to str2
stx(t)=stx(t)-2
sty(t)=sty(t)+sti(t)
if stx(t)<0 then stx(t)=640:sty(t)=rnd(480)
if sty(t)>480 then stx(t)=rnd(640):sty(t)=0:sti(t)=2+rnd(2)
next t
if cl=0 then tmrgo=tmrgo+1:if tmrgo=250 then tmrgo=0:if sny>440 then sny=sny-2
if cl=0 then box 1,sny,639,479
x=x+sp1
if x>640 then x=-160:y=y+spgo
if cl=1 then if level=5 then gosub submarine
if cl=0 then paste image 1,x,y,0
if cl=1 then gosub pl
amount=0
for tx=40 to 560 step 40
ok=0
if bx>tx-24 and bx<tx+4 then if by>bx(tx) then if bx(tx)<484 then bx(tx)=bx(tx)+sp2:sndok=sndok+1:ok=1
if x>tx-64 and x<tx-56 then if y>bx(tx)-20 then goto crash
if ok=1 then paste image 4,(tx-12)+rnd(24),bx(tx)-rnd(24)+rnd(24),0
if sndok=1 then play sound 2
if bx(tx)<480 then amount=amount+1
for ty=480 to bx(tx) step -12
paste image 2,tx,ty,0
next ty
next tx
if amount=0 then tmrx=tmrx+1:if tmrx=2 then tmrx=0:y=y+1
a$=inkey$()
if a$=" " and okgo=1 then okgo=0:bx=x+32:by=y+20:sndok=0:play sound 1
if by<484 then by=by+sp2:paste image 3,bx,by,0
if by>480 then okgo=1
if a$="c" then goto complete
if x>500 and y>340 or y>420 then goto complete
ink rgb(255,255,0),rgb(255,255,0)
if tmrxx<280 then tmrxx=tmrxx+1:text 264,200,"Level "+str$(level)
if cl=1 then if level=1 then gosub lvlxx
if cl=1 then if level=2 then cary=442:gosub cars
if cl=1 then if level=4 then cary=442:gosub cars
if flygo=1 then gosub fly
sync
goto 1
lvlxx:
for tx=0 to 640 step 32
paste image 16,tx,464,0
next tx
return
crash:
gosub sndx
for t=5 to 8
sprx(t)=x
spry(t)=y
spri(t)=2+rnd(2)
sprii(t)=2+rnd(2)
next t
tmr=0
tmrx=0
crashokgo:
cls rgb(0,0,0)
ink rgb(255,255,255),rgb(255,255,255)
for t=1 to str2
stx(t)=stx(t)-2
sty(t)=sty(t)+sti(t)
if stx(t)<0 then stx(t)=640:sty(t)=rnd(480)
if sty(t)>480 then stx(t)=rnd(640):sty(t)=0:sti(t)=2+rnd(2)
next t
if cl=0 then tmrgo=tmrgo+1:if tmrgo=250 then tmrgo=0:if sny>440 then sny=sny-2
if cl=0 then box 1,sny,639,479
for t=1 to str1
box stx(t),sty(t),stx(t)+1,sty(t)+1
next t
for t=5 to 8
sprx(t)=sprx(t)+spri(t)
spry(t)=spry(t)+sprii(t)
if cl=0 then sprite t,sprx(t),spry(t),t
next t
if y<400 then x=x+1:y=y+4
if cl=1 then paste image 29,x,y,0
for tx=40 to 560 step 40
for ty=480 to bx(tx) step -12
paste image 2,tx,ty,0
next ty
next tx
ink rgb(255,255,0),rgb(255,255,0)
text 264,200,"Game Over!"
if tmr<400 then tmr=tmr+1
if tmr=400 and scancode()=0 then goto start
sync
goto crashokgo
complete:
stop music 1
loop music 2
completeokgo:
cls rgb(0,0,0)
ink rgb(255,255,255),rgb(255,255,255)
for t=1 to str2
stx(t)=stx(t)-2
sty(t)=sty(t)+sti(t)
if stx(t)<0 then stx(t)=640:sty(t)=rnd(480)
if sty(t)>480 then stx(t)=rnd(640):sty(t)=0:sti(t)=2+rnd(2)
next t
if level=1 then gosub lvl1
if level=2 then gosub lvl2
if level=3 then gosub lvl3
if level=4 then gosub lvl4
if level=5 then gosub lvl5
if level=6 then gosub lvl6
if level=7 then gosub lvl7
if level=8 then gosub lvl8
if level=9 then paste image 11,0,0,0
if cl=0 then tmrgo=tmrgo+1:if tmrgo=250 then tmrgo=0:if sny>440 then sny=sny-2
if cl=0 then box 1,sny,639,479
for tx=40 to 560 step 40
for ty=480 to bx(tx) step -12
if level<9 then paste image 2,tx,ty,0
next ty
next tx
if y<440 and level<9 then x=x+1:y=y+1
if level=9 then if x>290 then x=x-2
if level=9 then if x<288 then x=x+2
if y<318 and level=9 then y=y+1
if cl=1 and level=9 then if y<318 then gosub pl
if cl=1 and level=9 then if y=318 then paste image 28,x-12,y-32,0
if cl=0 then paste image 1,x,y,0
if cl=1 and level<9 then if y<440 then gosub pl
if cl=1 and level<9 then if y=440 then paste image 28,x-12,y-32,0
if cl=1 then if level=1 then gosub lvlxx
ink rgb(255,255,0),rgb(255,255,0)
if level=9 then ink rgb(255,255,255),rgb(255,255,255)
if level<9 then text 264,200,"Congratulations!"
if level=9 then text 190,120,"****GAME COMPLETE****"
tmr=tmr+1
if tmr>800 and inkey$()=" " and level<9 then stop music 2:goto startokgo
if tmr>800 and inkey$()=" " and level=9 then stop music 2:goto start
sync
goto completeokgo
submarine:
for t=1 to 5
if rnd(500)=0 then subi(t)=rnd(1)
if subi(t)=0 then subx(t)=subx(t)-1
if subi(t)=1 then subx(t)=subx(t)+1
if subx(t)<-50 then subx(t)=subxx
if subx(t)>subxx then subx(t)=-50
if suby(t)<suby-10 then subii(t)=1
if suby(t)>suby+10 then subii(t)=0
if subii(t)=0 then suby(t)=suby(t)-1
if subii(t)=1 then suby(t)=suby(t)+1
paste image 10,subx(t),suby(t),0
next t
return
complete1:
load music "music/other.mid",2
play music 2
stop sound 1
x=20:y=40
tmr=0
complete2:
cls rgb(128,196,255)
paste image 11,0,0,0
if leftkey()=1 then if x>0 then x=x-2
if rightkey()=1 then if x<570 then x=x+2
if upkey()=1 then if y>20 then y=y-1
if downkey()=1 then if y<300 then y=y+1
gosub pl
set text to bold
if rnd(20)=0 then ink rgb(rnd(255),rnd(255),rnd(255)),rgb(64,128,255)
text 190,180,"****GAME COMPLETE****"
if rnd(10)=0 then ink rgb(rnd(255),255,255),rgb(255,255,255)
text 191,179,"****GAME COMPLETE****"
gosub submarine
if tmr<800 then tmr=tmr+1
if inkey$()=" " and tmr=800 then tmr=0:goto complete
sync
goto complete2