mardi 27 août 2019

my if condition is not working on processing language

im working on processing language for my assignment. its an animation. the animation object(a ball) needs to go from up to bottom. i have declared a variable {float x,y} whenever i put if condition to increase it by 1 but its not moving a single inch.

this is for mac 2011

float x;
float y;

size(600, 400)

x = 0.4*width/8;
y = 0.4*height/8;


ellipse( width/2, x, 0.8*width/8, 0.8*width/8);
ellipse( y, height/2, 0.8*height/8, 0.8*height/8);



if(x<height){
x=x+1;
}

if(y<width){
y=y+1;
}

i expect the output is- the ball located on top gows down and stop at the bottom and the left ball goes to right and stop at the rightmost point.

Aucun commentaire:

Enregistrer un commentaire