making the ball move both vertically but horizontally while it's changing to random colors

i have this code so far but i really just want to ball to move vertically and horizontally while it's changing colors at the same time, it'll be awesome if you guys can help, i'm also new here.

int y = 0;
int speed = 5;

void setup() {

  size (200,200); 

  smooth(); 
}

void draw() {
  background (255); 

  y = y + speed; 

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

  stroke (0); 

  fill(237,26,26);

  ellipse (100, y+16, 32, 32);
}

Answers

Sign In or Register to comment.