Redraw to draw around something
in
Programming Questions
•
6 months ago
Hi! As a beginner I stucked at my test code, however it's quite simple. Here it is:
- int a =0;
- int b = 0;
- int c = 0;
- int d = 0;
- void setup()
- {
- size(500,500);
- }
- void draw()
- {
- background(255);
- line(c,d,a,b);
- }
- void mouseMoved()
- {
- a = mouseX;
- b = mouseY;
- }
- void mouseClicked()
- {
- c = a;
- d = b;
- }
Could you help me with this issue?
Thanks!
Andrew
1