|
int ballx;
int x;
int y;
int x_direction;
int y_direction;
void setup(){
size(300,300);
x=0;
y=0;
x_direction=3;
y_direction=3;
}
void loop(){
background(0);
//ray
//x=x+x_direction;
// y=y+y_direction;
//if(x>150){
//fill(255,255,0);
//stroke(255,255,0);
// ellipse(x,y,5,5);
//}
//println(x);
//if(x>300){
//x =150;
//}
//if(y>300){
//y =150;
//}
//rightline
strokeWeight(1);
stroke(255);
for(int i=0; i<150; i=i+10){
line(i+150,150-i,i+150,i+150);
}
//leftline
for(int j=-10; j<150; j=j+10){
line(j,j,j,300-j);
}
//maru
ellipseMode(CENTER_DIAMETER);
fill(255);
ellipse(ballx,height/2,30,30);
}
void mouseDragged(){
ballx = mouseX;
}
|
|