Heres the top google definition for `particle`: (nontechnical usage) a tiny piece of anything.
And heres another google definition for `particles`: A particle defines a point in space. Particles are often animated and controlled by applying forces and other physics to them.
So basicly, were working with an array of things which we can define, and give physical properties to.
heres some fully tested code
Code:
'properties of our dust particle, x location, and a y location
'we could have added color, size, shape, speed, etc.
'anything, really
TYPE pDust
x AS INTEGER
y AS INTEGER
END TYPE
'here we create 10 dust particles (0 -> 9) with our pDust properties
DIM dust(9) AS pDust
'here we set the properties, ready to go
FOR i = 0 TO 9
dust(i).x = RND * 320
dust(i).y = RND * 200
NEXT
SCREEN 13
'main loop
DO
'defined behaviour of our dust particle:
'just move to the right,
'and if were off the screen, move back on and have a new Y position
FOR i = 0 TO 9
dust(i).x = dust(i).x + 1
IF dust(i).x >= 320 THEN
dust(i).x = 0
dust(i).y = RND * 200
END IF
NEXT
'display particles with white dots, and erase old ones with a black dot.
FOR i = 0 TO 9
PSET (dust(i).x - 1, dust(i).y), 0
PSET (dust(i).x, dust(i).y), 15
NEXT
'delay the program so it runs at a decent speed
WAIT &H3DA, 8
WAIT &H3DA, 8, 8
LOOP
To sum everything up, you have properties and behaviour. properties are what you define, and behaviour is how the properties interact. Maybe this will help. its a big enough rant heh.[/list]