show code
int precedentX;
int precedentY;
void setup() {
size (250, 250);
precedentX = width / 2;
precedentY = height / 2;
}
void draw () {
if (mousePressed) {
if (mouseButton == LEFT) {
line (mouseX, mouseY, precedentX, precedentY);
precedentX = mouseX;
precedentY = mouseY;
}
}
}
Laisser un commentaire