diff --git a/OGP1718-Worms/src/worms/model/Worm.java b/OGP1718-Worms/src/worms/model/Worm.java index 7fe992a..0a92d51 100644 --- a/OGP1718-Worms/src/worms/model/Worm.java +++ b/OGP1718-Worms/src/worms/model/Worm.java @@ -115,7 +115,7 @@ public class Worm { if (!isValidRadius(radius)) throw new IllegalArgumentException("Invalid radius"); - this.radius = radius; + setRadius(radius); this.minimumRadius = minimumRadius; this.actionPoints = this.maxActionPoints; @@ -296,9 +296,8 @@ public class Worm { */ private void setMass(double radius) { - final long rho = 1062; - double mass = rho * (4 / 3 * PI * pow(radius, 3)); - + final double rho = 1062.0; + double mass = rho * (4.0 / 3.0 * PI * pow(radius, 3)); this.mass = mass; setMaxActionPoints(mass); } @@ -594,6 +593,8 @@ public class Worm { * |result == this.actionPoints > 0 && this.orientation < Math.PI */ private boolean canJump() { + System.out.println(this.actionPoints); + System.out.println(this.orientation); return this.actionPoints > 0 && this.orientation < PI; }