// The Virus class class Virus { // Properties to help tracking and drawing the Virus float xpos; float ypos; float xgrowth; float ygrowth; color gcolor; float directionX, directionY; float velocityX, velocityY; // The constructor for the Virus class Virus(float _x, float _y, float _xg, float _yg, color _gcolor, float _directionX, float _directionY) { xpos = _x; ypos = _y; xgrowth = _xg; ygrowth = _yg; gcolor = _gcolor; directionX = _directionX; directionY = _directionY; } // Display function for the Virus void display() { noStroke(); fill(color(gcolor)); ellipse(xpos,ypos,xgrowth,ygrowth); } // Move function for the Virus void move() { velocityX = directionX; velocityY = directionY; xpos += velocityX; ypos += velocityY; } // Grow function for the Virus // Growth per frame circle set, if the virus cells grow bigger // Than 200 pixels we make sure they stop growing void grow() { // xgrowth = xgrowth + 0.05; // ygrowth = ygrowth + 0.05; if (xgrowth > 200) { xgrowth = 200; ygrowth = 200; } } }