Whenever I try to make a gradient by using lines of decreasing transparency, it makes things really, really slow. Are there other ways to make transparent gradients that don't slow things down to a crawl?
void drawLine(){
stroke(gray);
for (int i = 0; i < width; i++){
line(i, y, i, height);
}
stroke(100);
line(0, y, width, y);
}
}
If you comment it out it goes away. I know smooth() doesn't really do anything to the sketch as it is right now since it's just a bunch of lines, but eventually I'll be adding some stuff that could use smoothing.
PS. Why does it say this topic is reported as spam?
Hi, just a general question: if you have a line of code like
ball = new Circle(x, y);
in the draw() function, what happens to the data during each iteration? Does the old Circle object get discarded and a new one assigned to the variable "ball"? Or is there data piling up somewhere?
and I noticed that a couple of functions like colorMode() and filter() have numbers in their parameters. I thought these only worked if very specific parameters like 'RGB' or 'THRESHOLD' were used. What's going on here?
Hello, I'm trying to make a sketch where a lightning bolt hits the ground and, as soon as it does, a particle is emitted from where the bolt hit. I can get the particle to appear, but I can't get it to animate. Instead, every single frame of the animation appears simultaneously. What am I doing wrong? Here is the code (the first chunk is what goes in the main tab; press the SPACE BAR to activate the lightning):