martes, 29 de mayo de 2012

Proccesing



int x,y;
int pasox,pasoy;
boolean AB;


void setup (){
size(200,200);
x = 10;
y = 100;
pasox = 2;
pasoy = 0;
AB = true;


}
void draw (){
background (0,0,50);
ellipse (x,y,20,20);
x += pasox;
y += pasoy;


if (AB){
if (x > width || x < 0 ){
pasox *= -1;


}
}else{
if (y > width || y < 0 ){
pasoy *= -1; }
}
}


void mousePressed(){


if(AB){
println("mario");
AB = false;
x= x; 
pasox = 0;
y = y;
pasoy = 2;


}else{ 
if (AB = true);
y= y;
pasoy = 0;
x = x;
pasox = 2;
}
}

No hay comentarios:

Publicar un comentario en la entrada