DBP- De-Bug! - Centipede clone, no Media, 20 Lines
look what me & DBP can do!
set display mode 800,600,32 : sync on : sync rate 0 : sync : randomize timer() : autocam off : color backdrop 0 : hide mouse : set text font "arial black" : set text size 36 : dim dx(90) : dim dy(90) : dim m(200) : dim L(70) : center text 400,80,"DE-BUG!" : center text 400,200,"Shoot the bugs and mushrooms without getting hit." : center text 400,230,"Move and shoot with the mouse." : center text 400,290,"RED bugs bounce off mushrooms." : center text 400,320,"ORANGE bugs make mushrooms." : center text 400,350,"BLUE bugs eat mushrooms." : center text 400,380,"PINK flowers have deadly blooms." : center text 400,450,"PRESS ENTER TO START." : sync
GAMESTART: : for t=1 to 501 : if object exist(t) : ghost object off t : delete object t : endif : if mesh exist(t) : delete mesh t : endif : if image exist(t) : delete image t : endif : next t : for t=1 to 70 : dy(t)=-1 : dx(t)=1 : l(t)=0 : if rnd(1)=0 : dx(t)=-1 : endif : next t : l(0)=1 : score=0
repeat : until RETURNKEY() : set text size 20 : level=0 : spd#=3.0 : x=0 : make object sphere 2,4 : make object box 3,.5,2,.5 : make mesh from object 3,3 : for t=1 to 3 : inc x : add limb 2,x,3 : offset limb 2,x,0,2,(t-2) : inc x : add limb 2,x,3 : offset limb 2,x,0,-2,(t-2) : next t
make mesh from object 4,2 : make object 5,4,1 : add limb 5,1,4 : scale limb 5,1,75,75,75 : offset limb 5,1,0,0,2.25 : position object 5,0,0,0 : point object 5,10,0,0 : make mesh from object 5,5 : make object sphere 6,3,3,3 : make mesh from object 6,6 : scale object 6,145,100,145 : add limb 6,1,6 : scale limb 6,1,40,150,40 : offset limb 6,1,0,-1.5,0 : make mesh from object 7,6 : make object sphere 8,8 : scale object 8,70,70,70 : make mesh from object 8,8 : add limb 8,1,8
add limb 8,2,8 : add limb 8,3,8 : add limb 8,4,8 : offset limb 8,1,2.25,2.25,0 : offset limb 8,2,-2.25,2.25,0 : offset limb 8,3,2.25,-2.25,0 : offset limb 8,4,-2.25,-2.25,0 : make mesh from object 9,8 : make object 72,9,1 : ghost object on 72 : position object 72,999,999,999 : for t=2 to 8 : delete object t : next t : position light 0,0,0,125 : point light 0,0,0,0 : make object cube 1,3 : make mesh from object 1,1 : add limb 1,1,1 : scale limb 1,1,200,100,150 : offset limb 1,1,0,-3,0 : add limb 1,2,1 : scale limb 1,2,300,100,200
offset limb 1,2,0,-6,0 : scale object 1,50,50,50 : make mesh from object 2,1 : delete object 1 : make object 1,2,1 : color object 1,RGB(10,74,138) : GameOn=0 : create bitmap 1,32,32 : for y=0 to 31 : ink rgb(0,255-(y*9),y*4),0 : line 0,y,31,y : next y : get image 9,0,0,31,31 : delete bitmap 1 : make object cube 500,750 : set object light 500,0 : set object collision off 500 : set object cull 500,0 : texture object 500,9 : ghost object on 500 : for t=101 to 200 : m(t)=100 : make object t,7,1
LIVES=2 : GSBase#=0.01 : NME=40 : FT#=0.0 : ShotNum=9 : set object collision to boxes t : if t<154 : gosub PlaceMush : else : position object t,999,999,999 : hide object t : endif : next t : for t=10 to 12 : make object sphere t,1 : position object t,1999,1999,1999 : scale object t,120,120,400 : color object t,RGB(128,128,128) : next t : for t=30 to 60 : make object t,5,3 : position object t,rnd(140)-70,85+rnd(10),0 : ghost object on t
scale object t,100,80,100 : color object t,rgb(255-rnd(10)*10,0,0) : next t : make object 71,4,1 : add limb 71,1,4 : offset limb 71,1,0,0,3 : add limb 71,2,4 : offset limb 71,2,0,0,6 : add limb 71,3,4 : offset limb 71,3,0,0,9 : scale object 71,50,65,100 : rotate object 71,0,0,0 : position object 71,0,0,0 : point object 71,10,0,0 : make mesh from object 71,71 : delete object 71 : make object 71,71,1 : color object 71,RGB(255,128,0) : ghost object on 71 : position object 71,-999,0,0 : MAKE OBJECT 73,5,1 : position object 73,rnd(140)-70,-999,0 : rotate object 73,0,180,90
scale object 73,125,115,115 : color object 73,RGB(20,0,160) : a=(mousemovex()-mousemovey())*0 : ink rgb(100,50,200),0 : position camera 0,0,125 : point camera 0,0,0 : GameOn=1 : t1#=timer() : do : gs#=(timer()-t1#)*GSBase# : t1#=timer() : dec FT#,gs# : inc TGS#,GS# : if tgs#>20.0 : tgs#=0.0 : t=rnd(99)+101 : if object visible(t)=0 : show object t : Gosub PlaceMush : endif : endif : mx#=(mousemovex()*gs#)/2.05 : my#=(mousemovey()*gs#)/2.05
x#=object position x(1) : y#=object position y(1) : position object 1,x#-mx#,y#-my#,0 : if object collision(1,0)>0 : position object 1,x#,y#,0 : endif : x#=object position x(1) : y#=object position y(1) : if x#>70.0 : x#=70.0 : endif : if x#<-70.0 : x#=-70.0 : endif : if y#>-30.0 : y#=-30.0 : endif : if y#<-70.0 : y#=-70.0 : endif : position object 1,x#,y#,0 : if ft#<0.0 : if mouseclick()
inc ShotNum : if ShotNum>12 : ShotNum=10 : endif : if object in screen(ShotNum)=0 : position object ShotNum,x#,y#,0 : point object ShotNum,x#,y#+25,0 : ft#=1.75 : endif : endif : endif : for t=10 to 12 : move object t,gs#*6.5 : if object collision(t,71) or object collision(t,72) or object collision(t,73) : position object t,1999,1999,1999 : inc score,5 : endif : next t : for t=101 to 200 : if object visible(t) : if object collision(t,73) : dec m(t),(level) : endif
a=object collision(t,0) : if a>9 and a<13 : position object a,1999,1999,1999 : dec m(t),10 : inc score,2 : endif : if m(t)>50 : scale object t,m(t),m(t),m(t) : else : position object t,-999,0,0 : hide object t : endif : endif : next t : for t=30 to nme : if object exist(t) : if object visible(t) : a#=object position x(t)+(dx(t)*gs#*spd#*0.70) : b#=object position y(t) : if b#<-65.0 : dy(t)=1 : endif : if b#>-20.0
dy(t)=-1 : endif : if b#>60.0 : dec b#,gs# : endif : for u=30 to nme : if u<>t : set object collision off u : endif : next u : if object collision(t,0)>70 or a#>70.0 or a#<-70.0 : dx(t)=-dx(t) : a#=a#+(dx(t)*gs#*spd#) : b#=b#+(5.0*dy(t)*gs#) : endif : position object t,a#,b#,0 : if dx(t)=-1 : yrotate object t,180 : else : yrotate object t,0 : endif : if object in screen(t) : for u=10 to 12
if object collision(t,u) : z=rnd(99)+101 : if object visible(z)=0 : show object z : m(z)=100 : scale object z,100,100,100 : position object z,object position x(t),object position y(t),0 : yrotate object z,rnd(359) : color object z,rgb(0,50+rnd(10)*15,rnd(5)*25) : endif : position object u,1999,1999,1999 : position object t,rnd(140)-70,rnd(10)+75,0 : inc score,100 : endif : next u : endif : for u=30 to nme : set object collision on u : next u :endif : endif : next t : IF Level>0
if object in screen(71)=0 : if tgs#>19.0 : a=rnd(1) : a=(a*200)-100 : position object 71,a,rnd(90)-30,0 : if a=-100 : dx(71)=1 : yrotate object 71,180 : else : dx(71)=-1 : yrotate object 71,0 : endif : endif : endif : position object 71,object position x(71)+(dx(71)*gs#*spd#*0.75),object position y(71),0 : ENDIF : if object collision(71,0)=0 : t=rnd(99)+101 : if object visible(t)=0 : if object position x(71)>-75 and object position x(71)<75 : show object t : position object t,object position x(71),object position y(71)+4-rnd(8),0 : scale object t,100,100,100
m(t)=100 : yrotate object t,rnd(359) : color object t,rgb(0,50+rnd(10)*15,rnd(5)*25) : endif : endif : endif : IF Level>2 : if object in screen(73)=0 : if tgs#>19.0 : position object 73,rnd(140)-70,75,0 : endif : endif : position object 73,object position x(73),object position y(73)-(gs#*spd#),0 : ENDIF : if object collision(1,0)>12 and object collision(1,0)<100 : dec LIVES : for t=10 to 12 : position object t,1999,1999,1999 : next t : for t=101 to 200 : if m(t)<70 : position object t,999,999,999
hide object t : else : m(t)=100 : scale object t,100,100,100 : position object t,object position x(t)+1-rnd(2),object position y(t)+1-rnd(2),0 : endif : sync : next t : for t=30 to 60 : position object t,rnd(140)-70,80+rnd(10),0 : next t : position object 71,999,999,999 : position object 72,999,999,999 : position object 73,999,999,999 : position object 1,0,-40,0 : a=(mousemovex()-mousemovey())*0 : t1#=timer() : endif : level=score/2000 : if L(level)=0 : L(level)=1 : inc SPD#,0.05 : inc nme
inc GSBase#,0.00025 : if nme>60 : nme=60 : endif : if level mod 5=0 : if lives<3 : inc lives : endif : endif : endif : if level>4 : if object in screen(72)=0 : t=72 : gosub placemush : rotate object 72,0,0,rnd(359) : s=rnd(40) : color object 72,RGB(255-s,128-s,128-s) : Bloom#=10.0 : dy(t)=1 : endif : inc bloom#,gs#*dy(72)*spd#*0.33 : if bloom#>100.0 : dy(72)=-1
endif : if bloom#<9.0 : position object 72,999,999,999 : endif : scale object 72,Bloom#*1.5,Bloom#*1.5,Bloom#*1.5 : endif : if lives<0 : set text size 48 : center text 400,80,"GAME OVER!" : center text 400,180,"Final Score:" : center text 400,220,str$(score) : center text 400,300,"Press ENTER to play again," : center text 400,340,"or ESCAPE to quit." : sync : repeat : until returnkey() : set text size 20 : goto GAMESTART : endif : center text 400,0,"SCORE: "+str$(score) : center text 400,20,"LIVES: "+str$(lives) : sync : loop
PlaceMush: : I=0 : repeat : inc I : position object t,rnd(140)-70,rnd(128)-68,0 : until object collision(t,0)=0 or (GameOn=1 and I>10) : scale object t,100,100,100 : m(t)=100 : yrotate object t,rnd(359) : color object t,rgb(0,50+rnd(10)*15,rnd(5)*25) : return
Code Broken Up:
set display mode 800,600,32
sync on
sync rate 0
sync
randomize timer()
autocam off
color backdrop 0
hide mouse
set text font "arial black"
set text size 36
dim dx(90)
dim dy(90)
dim m(200)
dim L(70)
center text 400,80,"DE-BUG!"
center text 400,200,"Shoot the bugs and mushrooms without getting hit."
center text 400,230,"Move and shoot with the mouse."
center text 400,290,"RED bugs bounce off of mushrooms."
center text 400,320,"ORANGE bugs make mushrooms."
center text 400,350,"BLUE bugs eat mushrooms."
center text 400,380,"PINK flowers have deadly blooms."
center text 400,450,"PRESS ENTER TO START."
sync
GAMESTART:
for t=1 to 1001
if object exist(t)
ghost object off t
delete object t
endif
if mesh exist(t)
delete mesh t
endif
if image exist(t)
delete image t
endif
next t
for t=1 to 70
dy(t)=-1
dx(t)=1
l(t)=0
if rnd(1)=0
dx(t)=-1
endif
next t
l(0)=1
score=0
repeat
until RETURNKEY()
set text size 20
level=0
spd#=13.0
x=0
make object sphere 2,4
make object box 3,.5,2,.5
make mesh from object 3,3
for t=1 to 3
inc x
add limb 2,x,3
offset limb 2,x,0,2,(t-2)
inc x
add limb 2,x,3
offset limb 2,x,0,-2,(t-2)
next t
make mesh from object 4,2
make object 5,4,1
add limb 5,1,4
scale limb 5,1,75,75,75
offset limb 5,1,0,0,2.25
position object 5,0,0,0
point object 5,10,0,0
make mesh from object 5,5
make object sphere 6,3,3,3
make mesh from object 6,6
scale object 6,145,100,145
add limb 6,1,6
scale limb 6,1,40,150,40
offset limb 6,1,0,-1.5,0
make mesh from object 7,6
make object sphere 8,8
scale object 8,70,70,70
make mesh from object 8,8
add limb 8,1,8
add limb 8,2,8
add limb 8,3,8
add limb 8,4,8
offset limb 8,1,2.25,2.25,0
offset limb 8,2,-2.25,2.25,0
offset limb 8,3,2.25,-2.25,0
offset limb 8,4,-2.25,-2.25,0
make mesh from object 9,8
make object 72,9,1
ghost object on 72
position object 72,999,999,999
for t=2 to 8
delete object t
next t
position light 0,0,0,125
point light 0,0,0,0
make object cube 1,3
make mesh from object 1,1
add limb 1,1,1
scale limb 1,1,200,100,150
offset limb 1,1,0,-3,0
add limb 1,2,1
scale limb 1,2,300,100,200
offset limb 1,2,0,-6,0
scale object 1,50,50,50
make mesh from object 2,1
delete object 1
make object 1,2,1
color object 1,RGB(10,74,138)
GameOn=0
create bitmap 1,32,32
for y=0 to 31
ink rgb(0,255-(y*9),0),0
line 0,y,31,y
next y
get image 9,0,0,31,31
delete bitmap 1
make object cube 500,750
set object light 500,0
set object collision off 500
set object cull 500,0
texture object 500,9
ghost object on 500
for t=101 to 200
m(t)=100
make object t,7,1
LIVES=2
GSBase#=0.01
NME=40
FT#=0.0
ShotNum=9
set object collision to boxes t
if t<154
gosub PlaceMush
else
position object t,999,999,999
hide object t
endif
next t
for t=10 to 12
make object sphere t,1
position object t,1999,1999,1999
scale object t,120,120,400
color object t,RGB(128,128,128)
next t
for t=30 to 60
make object t,5,3
position object t,rnd(140)-70,85+rnd(10),0
ghost object on t
scale object t,100,80,100
color object t,rgb(255-rnd(10)*10,0,0)
next t
make object 71,4,1
add limb 71,1,4
offset limb 71,1,0,0,3
add limb 71,2,4
offset limb 71,2,0,0,6
add limb 71,3,4
offset limb 71,3,0,0,9
scale object 71,50,65,100
rotate object 71,0,0,0
position object 71,0,0,0
point object 71,10,0,0
make mesh from object 71,71
delete object 71
make object 71,71,1
color object 71,RGB(255,128,0)
ghost object on 71
position object 71,-999,0,0
MAKE OBJECT 73,5,1
position object 73,rnd(140)-70,-999,0
rotate object 73,0,180,90
scale object 73,125,115,115
color object 73,RGB(20,0,160)
a=(mousemovex()-mousemovey())*0
ink rgb(100,50,200),0
position camera 0,0,125
point camera 0,0,0
GameOn=1
t1#=timer()
do
gs#=(timer()-t1#)*GSBase#
t1#=timer()
dec FT#,gs#
inc TGS#,GS#
if tgs#>20.0
tgs#=0.0
t=rnd(99)+101
if object visible(t)=0
show object t
Gosub PlaceMush
endif
endif
mx#=(mousemovex()*gs#)/2.05
my#=(mousemovey()*gs#)/2.05
x#=object position x(1)
y#=object position y(1)
position object 1,x#-mx#,y#-my#,0
if object collision(1,0)>0
position object 1,x#,y#,0
endif
x#=object position x(1)
y#=object position y(1)
if x#>70.0
x#=70.0
endif
if x#<-70.0
x#=-70.0
endif
if y#>-30.0
y#=-30.0
endif
if y#<-70.0
y#=-70.0
endif
position object 1,x#,y#,0
if ft#<0.0
if mouseclick()
inc ShotNum
if ShotNum>12
ShotNum=10
endif
if object in screen(ShotNum)=0
position object ShotNum,x#,y#,0
point object ShotNum,x#,y#+25,0
ft#=1.75
endif
endif
endif
for t=10 to 12
move object t,gs#*6.5
if object collision(t,71) or object collision(t,72) or object collision(t,73)
position object t,1999,1999,1999
inc score,5
endif
next t
for t=101 to 200
if object visible(t)
if object collision(t,73)
dec m(t),(level)
endif
a=object collision(t,0)
if a>9 and a<13
position object a,1999,1999,1999
dec m(t),10
inc score,2
endif
if m(t)>50
scale object t,m(t),m(t),m(t)
else
position object t,-999,0,0
hide object t
endif
endif
next t
for t=30 to nme
if object exist(t)
if object visible(t)
a#=object position x(t)+(dx(t)*gs#*spd#*0.70)
b#=object position y(t)
if b#<-65.0
dy(t)=1
endif
if b#>-20.0
dy(t)=-1
endif
if b#>60.0
dec b#,gs#
endif
for u=30 to nme
if u<>t
set object collision off u
endif
next u
if object collision(t,0)>70 or a#>70.0 or a#<-70.0
dx(t)=-dx(t)
a#=a#+(dx(t)*gs#*spd#)
b#=b#+(5.0*dy(t)*gs#)
endif
position object t,a#,b#,0
if dx(t)=-1
yrotate object t,180
else
yrotate object t,0
endif
if object in screen(t)
for u=10 to 12
if object collision(t,u)
z=rnd(99)+101
if object visible(z)=0
show object z
m(z)=100
scale object z,100,100,100
position object z,object position x(t),object position y(t),0
yrotate object z,rnd(359)
color object z,rgb(0,50+rnd(10)*15,rnd(5)*25)
endif
position object u,1999,1999,1999
position object t,rnd(140)-70,rnd(10)+75,0
inc score,100
endif
next u
endif
for u=30 to nme
set object collision on u
next u
endif
endif
next t
IF Level>0
if object in screen(71)=0
if tgs#>19.0
a=rnd(1)
a=(a*200)-100
position object 71,a,rnd(90)-30,0
if a=-100
dx(71)=1
yrotate object 71,180
else
dx(71)=-1
yrotate object 71,0
endif
endif
endif
position object 71,object position x(71)+(dx(71)*gs#*spd#*0.75),object position y(71),0
ENDIF
if object collision(71,0)=0
t=rnd(99)+101
if object visible(t)=0
if object position x(71)>-75 and object position x(71)<75
show object t
position object t,object position x(71),object position y(71)+4-rnd(8),0
scale object t,100,100,100
m(t)=100
yrotate object t,rnd(359)
color object t,rgb(0,50+rnd(10)*15,rnd(5)*25)
endif
endif
endif
IF Level>2
if object in screen(73)=0
if tgs#>19.0
position object 73,rnd(140)-70,75,0
endif
endif
position object 73,object position x(73),object position y(73)-(gs#*spd#),0
ENDIF
if object collision(1,0)>12 and object collision(1,0)<100
dec LIVES
for t=10 to 12
position object t,1999,1999,1999
next t
for t=101 to 200
if m(t)<70
position object t,999,999,999
hide object t
else
m(t)=100
scale object t,100,100,100
position object t,object position x(t)+1-rnd(2),object position y(t)+1-rnd(2),0
endif
sync
next t
for t=30 to 60
position object t,rnd(140)-70,80+rnd(10),0
next t
position object 71,999,999,999
position object 72,999,999,999
position object 73,999,999,999
position object 1,0,-40,0
a=(mousemovex()-mousemovey())*0
t1#=timer()
endif
level=score/2000
if L(level)=0
L(level)=1
inc SPD#,0.05
inc nme
inc GSBase#,0.00025
if nme>60
nme=60
endif
if level mod 5=0
if lives<3
inc lives
endif
endif
endif
if level>4
if object in screen(72)=0
t=72
gosub placemush
rotate object 72,0,0,rnd(359)
s=rnd(40)
color object 72,RGB(255-s,128-s,128-s)
Bloom#=10.0
dy(t)=1
endif
inc bloom#,gs#*dy(72)*spd#*0.33
if bloom#>100.0
dy(72)=-1
endif
if bloom#<9.0
position object 72,999,999,999
endif
scale object 72,Bloom#*1.5,Bloom#*1.5,Bloom#*1.5
endif
if lives<0
set text size 48
center text 400,80,"GAME OVER!"
center text 400,180,"Final Score:"
center text 400,220,str$(score)
center text 400,300,"Press ENTER to play again,"
center text 400,340,"or ESCAPE to quit."
sync
repeat
until returnkey()
set text size 20
goto GAMESTART
endif
center text 400,0,"SCORE: "+str$(score)
center text 400,20,"LIVES: "+str$(lives)
sync
loop
PlaceMush:
I=0
repeat
inc I
position object t,rnd(140)-70,rnd(128)-68,0
until object collision(t,0)=0 or (GameOn=1 and I>10)
scale object t,100,100,100
m(t)=100
yrotate object t,rnd(359)
color object t,rgb(0,50+rnd(10)*15,rnd(5)*25)
return
My high score today:
55,938
What's yours?