too fast ?
Well ... try it that way :
Startpoint:
dim objx(3) : dim objy(3) : newobject = 1 : t = 8 : xdir = 1 : ydir = 0: maxlength = 768 : currentlength = 10 : dim xpos( 100 ) : dim ypos( 100 ) : score = 0 : time = 120000 : for r = 1 to currentlength : xpos(r)=320-10*(r-1) : ypos(r)=240 : next r
ink 0,0 : create bitmap 1, 10, 10 : ink RGB(255,255,255), 0 : circle 5,5,5 : get image 1, 0, 0, 10, 10 : delete bitmap 1 : ink rgb(255,255,255), rgb(255,255,255) : create bitmap 2, 10, 10 : box 0,0,10,10
ink rgb(0,255,0), 0 : box 3, 3, 7, 7 : get image 2, 0, 0, 10, 10 : ink rgb(0,0,255),0 : box 3,3,7,7 : get image 3,0,0,10,10 : ink rgb(255,0,0),0 : box 3,3,7,7 : get image 4,0,0,10,10 : set current bitmap 0
sync on : sync rate 0 : backdrop on : hide mouse : randomize timer() : set text font "Arial" : set text size 50
while escapekey() = 0 : ink rgb(255,255,255),rgb(255,255,255) : box 0, 0, 640, 480 : ink 0,0 : line 159, 119, 481, 119 : line 481, 119, 481, 361 : line 159, 119, 159, 361 : line 159, 361, 481, 361
if xpos( 1 ) <= 159 or xpos( 1 ) >= 471 or ypos( 1 ) <= 119 or ypos( 1 ) >= 351 or time < 1000 or currentlength = maxlength : wait 1000 : finish(score) : goto startpoint : endif
for r = currentlength to 1 step -1 : if r <> 1 : xpos( r ) = xpos( r-1 ) : ypos( r ) = ypos( r-1 ) : if xpos( r ) = xpos( 1 ) and ypos( r ) = ypos( 1 ) and r <> 2 : wait 1000 : finish(score) : endif
else : xpos( r ) = xpos( r ) + xdir * 10 : ypos( r ) = ypos( r ) + ydir * 10 : endif
for s = 1 to 3 : if xpos(r) = objx(s) and ypos(r) = objy(s) : inc currentlength : newobject = 1 : if s = 1 : inc score, 20 : endif : if s = 2
inc time, 10000 : endif : if s = 3 : dec time, 20000 : endif : endif : next s : if xpos( r ) >= 160 and xpos( r ) < 480 and ypos( r ) >= 120 and ypos( r ) < 360 : paste image 1, xpos( r ), ypos( r ) : endif : next r
for s = 1 to 3 : if newobject = 1 : objx(s) = rnd(31)*10+160 : objy(s) = rnd(23)*10+120 : endif : paste image s+1, objx(s), objy(s) : next s
wait 10
if downkey() = 1 and ydir <> -1 : ydir = 1 : xdir = 0 : endif : if upkey() = 1 and ydir <> 1: ydir = -1 : xdir = 0 : endif : if leftkey() = 1 and xdir <> 1 : xdir = -1 : ydir=0 : endif : if rightkey() = 1 and xdir <> -1 : xdir=1 : ydir=0 : endif
dec time, 125 : time$ = left$(str$(time/60000),1) + ": " + str$(time/1000-(val(left$(str$(time/60000),1))*60))
ink 0,0 : text 50, 420, "Score: " + str$(score) : text 590 - text width( time$ ), 420, time$ : newobject = 0 : sync : endwhile
function finish(score)
while inkey$() <> "r" : ink RGB(255,255,255), RGB(255,255,255) : box 0, 0, 640, 480 : ink RGB(179,38,73), RGB(179,38,73) : center text 320, 90, "Game Over!" : center text 320, 210, "Your Score: "+str$(score)
center text 320, 330, "R to restart, E to quit!" : if inkey$() = "e" then end
sync : endwhile : exitfunction
endfunction
Well done
"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll