if (direction == true)
g.drawAnimation(team1MovingR, (int) -radius, (int) -radius);
else
g.drawAnimation(team1Moving, (int) -radius, (int) -radius);
// Display HP over beaver's head
Color old = g.getColor();
g.setColor(Color.green);
g.pushTransform();
g.scale(scale, -scale);
g.drawString("HP=" + p1Team[i].getHP(), (int) -radius, -team1Moving.getHeight()-10);
if (currentPlayer.getCurrentBeaver().equals(p1Team[i])) {
// Draw the power bar over the current beaver's head
if (powerSeqEngaged) {
g.setColor(Color.red);
g.fillRect((int) -radius, -team1Moving.getHeight()-20, power/3, 10);
}
}
g.popTransform();
g.setColor(old);
}
if(body.equals(p2Team[i].getBody())&&p2Team[i].isAlive()){
// Get current beaver's direction *GIANNI*
boolean direction = p2Team[i].getFacingR();
if (direction == true)
g.drawAnimation(team2MovingR, (int) -radius, (int) -radius);
else
g.drawAnimation(team2Moving, (int) -radius, (int) -radius);
// Display HP over beaver's head
Color old = g.getColor();
g.setColor(Color.red);
g.pushTransform();
g.scale(scale, -scale);
g.drawString("HP=" + p2Team[i].getHP(), (int) -radius, -team2Moving.getHeight()-10);