Field Component.x is not visible!
in
Programming Questions
•
1 year ago
Im trying to make a simple ellipse move from A to B, but keep getting this error ..
- void setup() {
- size(800, 600);
- x = width / 2;
- y = height / 2;
- fill (#4060FF);
- strokeWeight(2);
- stroke(0);
- smooth();
- }
- void draw() {
- x += velX;
- y += velY;
- if (x+r >= width || x-r <= 0) {
- velX = -velX;
- }
- if (y+r >= height || y-r <= 0) {
- velY = -velY;
- }
- background(255);
- ellipse(x, y, d, d);
- }
1