int circleX=50;
int circleY=100;
int speed=1;
int x=0;
int y=1;
void setup (){
size(300,300);
}
void draw(){
background(200,43,0);
x=x+speed;
if ((x>width)||(x<0)){
speed = speed *-1;}
stroke(204, 102, 0);
fill(204, 102, 0);
smooth();
ellipse(x, 150,55,55);
circleX = circleX + 1;
circleY = circleY + 1;
y=circleX+y;
y=circleY+y;
if((x>width)||(x<0)){
circleX = circleX*-1;
circleY=circleY*-1;
}
}
No comments:
Post a Comment