This is a simple puzzle game. The object is to turn each of the red lights to green. When you click on a light, the light that you click on as well as the lights above it, below it, and to the left or right of it will change colour.
When it starts use the up or down arrow keys to adjust the grid size, then press the return key.
You can press R to return to the grid size selection.
Here is the 18 line version:
set display mode 640,480,16,0: sync on: set text font "Arial": ink rgb(0,0,255),0: set text size 20: number = 5: make object cube 700,1: set ambient light 100: hide light 0: rotate camera 0,0,0: color backdrop 0: autocam off
5:
do: center text screen width()/2,20,"Grid size?": center text screen width()/2,40,str$(number): if upkey(): u=u+1: else u=0: endif: if downkey(): d=d+1: else d=0: endif: if returnkey(): exit: endif: if u=1 and number < 10: number=number+1: endif: if d=1 and number>2 : number=number-1: endif: sync: loop
moves = 0: dim lights(number+1,number+1,2): position camera (number*50)/2+25,(number*50)/2+25,0
obj = 1: for y = 1 to number: for x = 1 to number: make object sphere obj, 30: position object obj,x*50,y*50,number*40: set object ambience obj, rgb(255,0,0): lights(x,y,1)=obj: lights(x,y,0)=0: obj = obj + 1: next x: next y
do: obj = pick object(mousex(),mousey(),1,number*number)
if mouseclick() then click=click+1 else click=0
for y = 1 to number: for x = 1 to number: if lights(x,y,0)=0: ok=0: endif: next x: next y: if ok=1 then exit
if click=1 and obj>0
for y = 1 to number: for x = 1 to number: if lights(x,y,1)=obj: lights(x,y,2)=1: lights(x-1,y,2)=1: lights(x+1,y,2)=1: lights(x,y-1,2)=1: lights(x,y+1,2)=1: endif: next x: next y
for y = 1 to number: for x = 1 to number: if lights(x,y,2)=1 then lights(x,y,0)=lights(x,y,0)+1: lights(x,y,2)=0: if lights(x,y,0)>1 then lights(x,y,0)=0
if lights(x,y,0)=0 then set object ambience lights(x,y,1),rgb(255,0,0) else set object ambience lights(x,y,1),rgb(0,255,0)
next x: next y: moves=moves+1: ok=1
endif
if lower$(inkey$())="r" then for i = 1 to number*number: delete object i: next i: goto 5
center text screen width()/2,20,"MOVES: " + str$(moves)
sync: loop
do: center text screen width()/2,screen height()/2,"COMPLETE!": center text screen width()/2,screen height()/2+40,"MOVES: " + str$(moves): sync: if inkey$()<>"": for i = 1 to number*number: delete object i: next i: goto 5: endif: loop
Here's the uncompressed version:
set display mode 640,480,16,0
sync on
set text font "Arial": ink rgb(0,0,255),0: set text size 20
make object cube 700,1: set ambient light 100: hide light 0
rotate camera 0,0,0: color backdrop 0: autocam off
number = 5
5:
do
center text screen width()/2,20,"Grid size?"
center text screen width()/2,40,str$(number)
if upkey() then u=u+1 else u=0
if downkey() then d=d+1 else d=0
if returnkey() then exit
if u=1 and number < 10 then number=number+1
if d=1 and number>2 then number=number-1
sync
loop
moves = 0
dim lights(number+1,number+1,2)
position camera (number*50)/2+25,(number*50)/2+25,0
obj = 1
for y = 1 to number
for x = 1 to number
make object sphere obj, 30
position object obj,x*50,y*50,number*40
set object ambience obj, rgb(255,0,0)
lights(x,y,1)=obj: lights(x,y,0)=0
obj = obj + 1
next x
next y
do
obj = pick object(mousex(),mousey(),1,number*number)
if mouseclick() then click=click+1 else click=0
ok=1
for y = 1 to number
for x = 1 to number
if lights(x,y,0)=0 then ok=0
next x
next y
if ok=1 then exit
if click=1 and obj>0
for y = 1 to number
for x = 1 to number
if lights(x,y,1)=obj
lights(x,y,2)=1: lights(x-1,y,2)=1: lights(x+1,y,2)=1: lights(x,y-1,2)=1: lights(x,y+1,2)=1
endif
next x
next y
for y = 1 to number
for x = 1 to number
if lights(x,y,2)=1 then lights(x,y,0)=lights(x,y,0)+1: lights(x,y,2)=0: if lights(x,y,0)>1 then lights(x,y,0)=0
if lights(x,y,0)=0 then set object ambience lights(x,y,1),rgb(255,0,0) else set object ambience lights(x,y,1),rgb(0,255,0)
next x
next y
moves=moves+1
endif
if lower$(inkey$())="r" then for i = 1 to number*number: delete object i: next i: goto 5
center text screen width()/2,20,"MOVES: " + str$(moves)
sync
loop
do
center text screen width()/2,screen height()/2,"COMPLETE!"
center text screen width()/2,screen height()/2+40,"MOVES: " + str$(moves)
if inkey$()<>"" then for i = 1 to number*number: delete object i: next i: goto 5
sync
loop
The .EXE is attached incase you don't have DBPro.