class Triangle extends Soldier { Triangle(float x, float y) { super(x, y); } /* draws the soldier */ void draw() { // draw the shape first fill(colour); float half = (strength+MIN_SIZE)/2.0; triangle(xPos, yPos-half, xPos-half, yPos+half, xPos+half, yPos+half); // draw the number over it fill(0); text(strength, xPos, yPos); } }