I'm working on writing a simple particle generator, starting with one that just dims as it goes outward. This is my first simple attempt at it but a single act() cycle takes a full second. I'm assuming it doesn't like a for() within a for()?
The only way I can think of right now to do this would be using a for() within a for(), any suggestions on what direction I should take to continue? I seem to be unable to find any articles online for how to go about coding a particle generator, but I'll keep looking.
for(int xp = 0; xp < canvasImg.getWidth(); xp++) { for(int yp = 0; yp < canvasImg.getHeight(); yp++) { int alphaRef = (int)abs(Math.hypot(centerX - xp, centerY - yp)); int alpha = 255 - alphaRef; canvasImg.setColorAt(0, 0, new Color(0, 0, 0, alpha)); } }