float speed = 1;
void setup() {
size(400, 300);
}
void draw() {
background(255);
move();
display();
}
void move() {
x = x + speed;
if (x > 350) {
speed = 0;
}
}
void display(x,y) {
fill(#FF2121);
translate(x,y);
ellipse(0, 0, 60, 60);
rect(-10, 15, 20, 100);
}
Unexpected token: x on "Void display (x,y)" Basically this program moves the ellipse and rect to other side of the window. is this the right way to do it? or is there any other easy way.
Example 0 = ellipse [] = rect
move to other side of window (speed of 1) and when it hit the edge, both them stop.