Code Wed Apr 1

Main Tab Code

Ball ball1; //declare the variable

//initialization
void setup(){
  size( 400, 400);
  colorMode(HSB, 360, 100, 100);
  //Ball( float x, float y, float size  ){
  ball1 = new Ball( 10, 10, 50, color(0)); //create the object instance
  ball1.speedX= 5; //to 
 }
 
 
void draw(){
  background(360);
  ball1.move();
  ball1.display();
}

Ball Class Tab Code

Last updated

Was this helpful?