Thx all, now it function well
Rem Project: myDBPro
Rem Created: 15/05/03 16.20.26
Rem ***** Main Source File *****
TYPE particel
X# as float
Y# as float
Xi# as float
Yi# as float
WgT# as float
ENDTYPE
dim P(0) AS particel
set display mode 640,480,16
randomize timer()
numParticles = 10
Term_V#=8
set text font "arial"
set text size 20
repeat
ink rgb(0,0,255),rgb(0,0,255)
cls
for i=1 to numparticles
randomize timer()
x#=rnd(8)-4
y#=rnd(2)-9
Particles(320,480,x#,y#,0.1)
next i
ink rgb(0,255,0),rgb(0,255,0)
text 0,0,"Particles:" + STR$(ARRAY COUNT(P(0)))
text 0,25,"FPS:" + str$(screen fps())
Calc_Particles()
Draw_Particles()
sync
until spacekey()=1
function Particles(pX#,pY#,pXi#,pYi#,pWgT#)
array insert at bottom P(0)
P().X#=pX#
P().Y#=pY#
P().Xi#=pXi#
If pYi#>Term_V# Then pYi#=Term_V#
P().Yi#=pYi#
P().WgT#=pWgT#
endfunction
Function Calc_Particles()
array index to top p(0)
for i =1 to array count(p(0))
next array index p(0)
P().X#=P().X#+P().Xi#
P().Y#=P().Y#+P().Yi#
P().Yi#=P().Yi#+P().WgT#
If (P().Yi# < Term_V#) then P().Yi#=P().Yi#+P().WgT#
If (P().Y#>640 or P().Y#<0) Then array delete element p()
next i
EndFunction
function Draw_Particles()
array index to top p(0)
for i =0 to array count(p(0))
next array index p(0)
ink rgb(255,rnd(255),0),rgb(255,0,0)
dot p().X#,p().Y#
next i
endfunction
General Army Corps Robert E. Lee
Army of North Virginia (1861-1865)