I've been playing around with DarkBASIC for more than 3 years now, off-and-on (well, more OFF than on), but I'm determined to give it a fair go, now. However, I've run into something rather odd when coding a simple Nibbles clone. When I execute my code, I encounter a major system slowdown. It takes several seconds just for the window to completely appear. Ctrl-Alt-Del to bring up the task monitor takes FOREVER, and if you look at my specs, that's not easy to do. Can someone tell me if there's something glaringly obvious in the below code that may explain these symptoms? Keep in mind, I just threw this together in about 15 minutes. I'm just trying to get something to work.
sync on : sync rate 40 : backdrop off : hide mouse
dim player_location(4)
player_location(1)=400
player_location(2)=300
player_location(3)=410
player_location(4)=310
do
cls
draw_map()
draw_player(player_location(1),player_location(2),player_location(3),player_location(4))
if upkey()=1
player_location(2)=player_location(2)-5
player_location(4)=player_location(4)-5
endif
if downkey()=1
player_location(2)=player_location(2)+5
player_location(4)=player_location(4)+5
endif
if leftkey()=1
player_location(1)=player_location(1)-5
player_location(3)=player_location(3)-5
endif
if rightkey()=1
player_location(1)=player_location(1)+5
player_location(3)=player_location(3)+5
endif
loop
function draw_map()
ink rgb(255,0,0),rgb(0,0,0)
box 20,20,780,580
ink rgb(0,0,0),rgb(0,0,0)
box 25,25,775,575
endfunction
function draw_player(x1,y1,x2,y2)
ink rgb(255,0,0),rgb(0,0,0)
box x1,y1,x2,y2
endfunction
/* You are not expected to understand this. */
Dual Athlon 2.0/1GB RAM/GeForce Ti4200-128/Win2000 Pro