This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Im fooling around with a small particle engine for J2ME, and for each particle (in the particle flock) I need to generate a beginning x and y value, and an "update/speed vector" (xi,yi) with the help of Random.
Emperical tests shows, that the particles tend to flock together. I suspect, that util.Random "reuses" the generated values..
does anyone have any info on the above?
In general about the engine:
loop thru' the flock of particles: if particle p is active -> p.update else reset p
particle.update() x= x + xi y= y + yi
particle.reset() sets the x,y,xi and yi values with random.nextInt() % 3