Here is a tron game in 16 lines of code. I don't know if it runs in DBP but try it!
Features:
-1 Player mode with AI
-2 Player mode
-Self destruct by pushing against the direction you are heading
Controls:
-Player 1 : Arrow keys
-Player 2 : W,A,S,D
rem tron
rem by TheComet
rem Slinki Software
start:
time=150:wait 1000:input "1--> 1 Player 2--> 2 Player >",a$:sync on:sync rate 60:backdrop on:color backdrop 0:hide mouse:dim x(1,640,480):time=100:sx=screen width():sy=screen height():do
if time<240:ink rgb(255,0,0),0:dot 160,240:ink rgb(0,255,0),0:dot 480,240:inc time:if time=240:cls:backdrop off:d1=4:x1=160:y1=240:d2=3:x2=480:y2=240:endif:if time<220:center text 320,240,"Ready?!":else
center text 320,240,"GO!!!!":endif
else:if upkey()=1:d1=2:endif:if downkey()=1:d1=1:endif:if leftkey()=1:d1=3:endif:if rightkey()=1:d1=4:endif:if a$="2":if keystate(17)=1:d2=2:endif:if keystate(31)=1:d2=1:endif:if keystate(30)=1:d2=3:endif
if keystate(32)=1:d2=4:endif:else:if rnd(50)=0:if d2=1 or d2=2:d2=rnd(1)+3:endif:if d2=3 or d2=4:d2=rnd(1)+1:endif:endif:if d2=3:if x(0,x2-1,y2)=1 or x(1,x2-1,y2)=1 or x2<2:if x(0,x2,y2+1)=0 and x(1,x2,y2+1)=0 and y2<478:d2=1:endif
if x(0,x2,y2-1)=0 and x(1,x2,y2-1)=0 and y2>2:d2=2:endif:endif:endif
if d2=4:if x(0,x2+1,y2)=1 or x(1,x2+1,y2)=1 or x2>638:if x(0,x2,y2+1)=0 and x(1,x2,y2+1)=0 and y2<478:d2=1:endif:if x(0,x2,y2-1)=0 and x(1,x2,y2-1)=0 and y2>2:d2=2:endif:endif:endif
if d2=1:if x(0,x2,y2+1)=1 or x(1,x2,y2+1)=1 or y2>478:if x(0,x2+1,y2)=0 and x(1,x2+1,y2)=0 and x2<638:d2=4:endif:if x(0,x2-1,y2)=0 and x(1,x2-1,y2)=0 and x2>2:d2=3:endif:endif:endif
if d2=2:if x(0,x2,y2-1)=1 or x(1,x2,y2-1)=1 or y2<2:if x(0,x2+1,y2)=0 and x(1,x2+1,y2)=0 and x2<638:d2=4:endif:if x(0,x2-1,y2)=0 and x(1,x2-1,y2)=0 and x2>2:d2=3:endif:endif:endif:endif
if d1=1:inc y1:endif:if d1=2:dec y1:endif:if d1=3:dec x1:endif:if d1=4:inc x1:endif:if x(1,x1,y1)=0 and x(0,x1,y1)=0 and x1>0 and x1<sx and y1>0 and y1<sy:x(0,x1,y1)=1:else:goto lose1:endif:ink rgb(255,0,0),0:dot x1,y1
if d2=1:inc y2:endif:if d2=2:dec y2:endif:if d2=3:dec x2:endif:if d2=4:inc x2:endif:if x(0,x2,y2)=0 and x(1,x2,y2)=0 and x2>0 and x2<sx and y2>0 and y2<sy:x(1,x2,y2)=1:else:goto lose2:endif:ink rgb(0,255,0),0:dot x2,y2:endif:sync:loop
lose1:
do:ink rgb(255,255,0),0:center text x1,y1-5,"BOOM!!":center text x2,y2-5,"Winner!!":sync:if returnkey()=1:goto start:endif:loop
lose2:
do:ink rgb(255,255,0),0:center text x2,y2-5,"BOOM!!":center text x1,y1-5,"Winner!!":sync:if returnkey()=1:goto start:endif:loop
Have fun and please comment!
TheComet
Peachy, and the Chaos of the Gems
