You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Bouncing Algorithm when the Ball hit the edge of the canvas
x=x+vx
y=y+vy
if x<0 or x>WIDTH:
vx=-vx
x=x+vx
if y<0 or y>HEIGHT:
vy=-vy
y=y+vy
#Draw ball
ellipse(x,y,30,30)
draw = moveBall
run() #This function from the processing library will call the setup() function once and then the moveBall() function every x ms to create the frame based animation.