I wrote this for the DBC challenge and decided to compress it. This is my first time doing this, didn't know we had to rewrite so many parts LOL. Took me long enough to get done.
Use the arrow keys to control the fish.
set display mode 640,480,16:sync on:sync rate 60:Fish = 1000:Bubble = 2000:DT(8,0,20,16,0,rgb(230,180,80),0):DT(20,0,32,16,1,rgb(230,180,80),0):ink rgb(10,10,10),0:dot 26,7
DT(0,2,8,14,1,rgb(230,180,80),1):DT(1,2,8,13,1,rgb(250,210,140),2):DT(3,2,8,12,1,rgb(255,230,200),3):DT(1,1,8,15,1,rgb(200,150,20),4):DT(3,0,8,16,1,rgb(180,130,10),5)
for lp=1 to 4:cls 0:n#=(100-(25*lp)):r=((255-50)/100.0)*n#:g=((255-80)/100.0)*n#:b=((255-220)/100.0)*n#:ink rgb(50+r,80+g,220+b),0:circle 16,16,3+lp:get image Bubble+lp,0,0,32,32,1:next lp
dim Swim(100):FrameMax = 0:Ani$ = "01122110334433":for lp = 0 to len(Ani$):inc FrameMax:Swim(lp) = val(mid$(Ani$,lp+1)):next lp:MaxBubble = 20:c = MaxBubble:
dim Bubble(c):dim BubbleX(c):dim BubbleY(c):dim BubbleX#(c):dim BubbleY#(c):Depth# = 100:create bitmap 1,640,480
do:cls rgb(50,80,220):for lp = 0 to MaxBubble:if Bubble(lp):paste image Bubble+Bubble(lp),BubbleX(lp),BubbleY(lp),1:endif:next lp:if Depth#<0:D=Depth#*-1:if D>479:D = 479:endif:ink rgb(215,225,255),0:box 0,0,639,0+D:endif
if Depth#>500:D=Depth#-500:if D>479:D=479:endif:ink rgb(100,80,20),0:box 0,479-D,639,479:endif:sprite 1,280,220,Fish+Swim(int(Frame#)):if FishMirror:if sprite Mirrored(1) = 0:mirror sprite 1:endif:else
if sprite Mirrored(1) = 1:mirror sprite 1:endif:endif:paste sprite 1,280,220: if Spd#<0:Spd#=0:endif:Frame#=Frame#+.3+Spd#:if Frame#=>FrameMax:Frame#=0:endif:Spd#=0:Depth#=Depth# + ScrollY#:if Depth#>750:Depth#=750:endif
if upkey() and Depth#>-220:ScrollY# = ScrollY#-.1:if ScrollX#<-8:ScrollY#=-8:endif:Spd#=ScrollY#/-10.0:else:if ScrollY#<0:ScrollY#=ScrollY#+.3:if ScrollY#>-.4:ScrollY#=0:endif:endif:endif
if downkey() and Depth#<750 or Depth#<-220:ScrollY#=ScrollY#+.1:if Depth#<-220:ScrollY#=ScrollY#+.1:endif:if ScrollY#>8:ScrollY#=8:endif:Spd#=ScrollY#/10.0:else:if ScrollY#>0:ScrollY#=ScrollY#-.3:if ScrollY#<.4:ScrollY#=0:endif
endif:endif:if leftkey():ScrollX#=ScrollX#-.1:if ScrollX#<-8:ScrollX#=-8:endif:Spd#=ScrollX#/-10.0:FishMirror=1:else:if ScrollX#<0:ScrollX#=ScrollX#+.1:if ScrollX#>-.3:ScrollX#=0:endif:endif:endif
if rightkey():ScrollX#=ScrollX#+.1:if ScrollX#>8:ScrollX#=8:endif:Spd#=ScrollX#/10.0:FishMirror=0:else:if ScrollX#>0:ScrollX#=ScrollX#-.1:if ScrollX#<.3:ScrollX#=0:endif:endif:endif:for lp=0 to MaxBubble
if Bubble(lp):BubbleX#(lp)=BubbleX#(lp)+(rnd(3)-1)/10.0:if BubbleX#(lp)<-1:BubbleX#(lp)=-1:endif:if BubbleX#(lp)>1:BubbleX#(lp)=1:endif:BubbleX(lp)=BubbleX(lp)+BubbleX#(lp)-ScrollX#:BubbleY(lp)=BubbleY(lp)-BubbleY#(lp)-ScrollY#
if BubbleY(lp)<-100:Bubble(lp)=0:endif:if BubbleY(lp)>550:Bubble(lp)=0:endif:if BubbleX(lp)<-40:Bubble(lp)=0:endif:if BubbleX(lp)>680:Bubble(lp)=0:endif:else:Bubble(lp)=rnd(3)+1:BubbleX#(lp)=rnd(3)-1:BubbleY#(lp)=rnd(30)/10.0+.5
BubbleX(lp)=rnd(640):BubbleY(lp)=480+rnd(64):if rnd(1):if rnd(1):if ScrollX#<0:BubbleX(lp)=rnd(32)*-1:BubbleY(lp)=rnd(500):endif:if ScrollX#>0:BubbleX(lp)=640+rnd(32):BubbleY(lp)=rnd(500):endif:else
if ScrollY#<0:BubbleX(lp)=rnd(640):BubbleY(lp)=rnd(100)*-1:endif:if ScrollY#>0:BubbleX(lp)=rnd(640):BubbleY(lp)=480+rnd(64):endif:endif:endif:endif:next lp:copy bitmap 1,0:sync:loop
Function DT(x1,y1,x2,y2,Mode,c,F)
ink c,0:lpx#=0:hx#=(y2-y1)/2.0:y#=x2-x1:x#=hx#/y#:if Mode=0:a=x1:b=x2:s=1:else:a=x2:b=x1:s=-1:endif:for lpy=a to b step s:line lpy,(y1+hx#)-lpx#,lpy,(y2-hx#)+lpx#:lpx#=lpx#+x#:next lpy
if F>0:get image 999+F,0,0,32,16,1:ink 0,0:box 0,0,8,16:endif:EndFunction
