this is just a little project exploring some ideas about the screen.
it is like a combination of TRON light cycles and the classic arcade game
QIX.
move your white dot around the screen with the arrow keys.
draw parallel lines to begin filling in the screen.
green dots are insurmountable obstacles.
it is imposible to die. you can move on black or blue,
but not red or green.
when enough of the screen is claimed (blue for you, red for the AI)
the round ends. press any key to start next round.
at end of round, you see how much you and the AI claimed.
press space bar at any time to start a new round immediately.
here is the code, just cut&paste. no media.
` qixtron
` by bob saunders
` astrumgames.com
set display mode 100,75,16
backdrop off
sync on
sync rate 0
sync
randomize timer()
global m2x
global m2y
global p2x
global p2y
dim sqa(100,75)
start_here:
for x=0 to 99
for y=0 to 74
sqa(x,y)=0
if rnd(90)=0
sqa(x,y)=3
endif
next y
next x
ink rgb(0,0,255),0
p1x=9
p1y=37
mx=1
my=0
p2x=90
p2y=37
m2x=-1
m2y=0
do
inc ct
if ct=3 then ct=1
for chicken=1 to 2
if rnd(16)=1
redirai()
endif
p2x=p2x+m2x
p2y=p2y+m2y
b=sqa(p2x,p2y)
if p2x<1 or p2x>98 or p2y<1 or p2y>73 or (b<>0 and b<>2)
p2x=p2x-m2x
p2y=p2y-m2y
redirai()
endif
sqa(p2x,p2y)=2
next chicken
if rightkey()
mx=1
my=0
endif
if leftkey()
mx=-1
my=0
endif
if upkey()
mx=0
my=-1
endif
if downkey()
mx=0
my=1
endif
p1x=p1x+mx
p1y=p1y+my
b=sqa(p1x,p1y)
if p1x<1 or p1x>98 or p1y<1 or p1y>73 or b>1
p1x=p1x-mx
p1y=p1y-my
mx=-mx
my=-my
endif
sqa(p1x,p1y)=1
q=fill_in()
sco1=0
sco2=0
` draw the screen here:
for x=0 to 99
for y=0 to 74
a=sqa(x,y)
dot x,y,rgb((a=2)*255,(a=3)*255,(a=1)*255)
sco1=sco1+(a=1)
sco2=sco2+(a=2)
next y
next x
if sco1+sco2>6000
repeat
q=fill_in()
until q<3
sco1=0
sco2=0
for x=0 to 99
for y=0 to 74
a=sqa(x,y)
sco1=sco1+(a=1)
sco2=sco2+(a=2)
dot x,y,rgb((a=2)*255,(a=3)*255,(a=1)*255)
next y
next x
sync
wait 1000
end_round(sco1,sco2)
endif
dot p1x,p1y,rgb(255,255,255)
dot p2x,p2y,rgb(255,255,255)
if spacekey() then goto start_here
sync
loop
function redirai()
z=0
repeat
c=rnd(3)
select c
case 0
m2x=1
m2y=0
endcase
case 1
m2x=-1
m2y=0
endcase
case 2
m2x=0
m2y=-1
endcase
case 3
m2x=0
m2y=1
endcase
endselect
p2x=p2x+m2x
p2y=p2y+m2y
b=sqa(p2x,p2y)
p2x=p2x-m2x
p2y=p2y-m2y
inc z
until b=0 or z=10 or (z>5 and b=2)
endfunction
function end_round(s1,s2)
cls
text 20,10,str$(s1)
text 20,30,"vs."
text 20,50,str$(s2)
sync
wait 1000
wait key
goto start_here
endfunction
function fill_in()
q=0
for x=0 to 99
for y=0 to 74
a=sqa(x,y)
if a=0
hits=0
for u=x-2 to x+2
for v=y-2 to y+2
if sqa(u,v)=1 then inc hits
next v
next u
if hits>10
sqa(x,y)=1
inc q
endif
hits=0
for u=x-2 to x+2
for v=y-2 to y+2
if sqa(u,v)=2 then inc hits
next v
next u
if hits>10
sqa(x,y)=2
inc q
endif
endif
next y
next x
endfunction q
quite curious what people think.
bob
http://astrumgames.com
completed games: Astrum Erus, Centipoid, Hero Of Garaven, WarpFlight, Higher Ground , Circular Breakout