x-post Processing Forum
I'm trying to make a super simple sketch where the user inputs a point with mousePressed, then (after a delay), processing plots a point at a random place on the screen back at you, and the points slowly fade into a semitransparent background. Here's my code, I've tried a bunch of different ideas but nothing seems to have worked, and now I'm at a point where nothing is working at all. Any pointers?
void setup() {
size(600, 600);
background(0);
stroke(color(168, 168, 168));
strokeWeight(2);
frameRate(60);
smooth();
}
void draw() {
if (mousePressed) {
ellipse(mouseX,mouseY,20,20);
}
else if (mousePressed) {
delay(10);
ellipse(random(mouseX), random(mouseY),20,20);
}
else {
fill(0,55,0, 2);
rect(0, 0, width, height, 2);
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…