Class defines a particle color... how do i redefine the color, dynamically, in Draw?
in
Programming Questions
•
1 year ago
I'm fairly new to Processing and programming in general.
- void display() {
- stroke(255, lifespan);
- fill(255, lifespan);
- ellipse(location.x, location.y, 4, 4);
- }
...but I want to redefine that color at run time, in Draw. I want the color to change dynamically based on certain variables. Any way I can make this happen? Here is the code, pertaining to the particle system that I have in draw... It works fine, but just calls the particle system with the color already defined in the class.
- if (brightness(c) > 160) {
- translate(x+cellSize/2, y+cellSize/2);
- ps.addParticle();
- ps.run();
- }
1