I get high 70's dropping to low 70's on my laptop
Still, with a small optimisation, I can boost it into the mid-90's
With yet another, I can boost it to 106 constant
Stand back! Master of optimisation at work
sync on
sync rate 0
#constant MAX_DOTS 2000
type Dot_t
x as integer
y as integer
endtype
dim Level(639) as integer
dim Dots(MAX_DOTS) as Dot_t
global Top = -1
for i=0 to 639
Level(i) = 480
next i
set text opaque
do
AddSnow( rnd(639), -1 )
lock pixels
for i=0 to Top
if Dots(i).y < Level( Dots(i).x )
dot Dots(i).x, Dots(i).y, 0
inc Dots(i).y
dot Dots(i).x, Dots(i).y
else
dec Level( Dots(i).x )
Dots(i) = Dots(Top)
dec Top
endif
next i
unlock pixels
set cursor 0,0
print "FPS: ";screen fps(); " "
sync
loop
function AddSnow(x, y)
AddDot(x, y+1)
AddDot(x, y-1)
AddDot(x-1, y)
AddDot(x+1, y)
endfunction
function AddDot(x, y)
if Top < MAX_DOTS
inc Top
Dots(Top).x = x
Dots(Top).y = y+1
endif
endfunction