diff --git a/core/src/de/samdev/cannonshooter/entities/Cannon.java b/core/src/de/samdev/cannonshooter/entities/Cannon.java index 68ae0f8..1815176 100644 --- a/core/src/de/samdev/cannonshooter/entities/Cannon.java +++ b/core/src/de/samdev/cannonshooter/entities/Cannon.java @@ -141,4 +141,8 @@ public class Cannon extends Entity { health = 1; } } + + public float getBoost() { + return barrel.getBoost(); + } } diff --git a/core/src/de/samdev/cannonshooter/entities/CannonBarrel.java b/core/src/de/samdev/cannonshooter/entities/CannonBarrel.java index ce16c93..c19f183 100644 --- a/core/src/de/samdev/cannonshooter/entities/CannonBarrel.java +++ b/core/src/de/samdev/cannonshooter/entities/CannonBarrel.java @@ -77,8 +77,7 @@ public class CannonBarrel extends Entity { private void updateCharge(float delta) { if (cannon.health == 0 || cannon.health == 1) { - if (loaded) - { + if (loaded) { charge += CHARGE_SPEED * getBoost() * delta * cannon.team.speedMultiplier; if (charge > 1) { diff --git a/core/src/de/samdev/cannonshooter/entities/CannonHearth.java b/core/src/de/samdev/cannonshooter/entities/CannonHearth.java index 4fe2922..0dcacfb 100644 --- a/core/src/de/samdev/cannonshooter/entities/CannonHearth.java +++ b/core/src/de/samdev/cannonshooter/entities/CannonHearth.java @@ -14,6 +14,7 @@ import de.samdev.cannonshooter.ZLayers; public class CannonHearth extends Entity { private static final Color COLOR_HEARTLESS = new Color(0.75f, 0.75f, 0.75f, 1f); private static final float ROTATION_SPEED = 0.125f; + private static final float ROTATION_MODULO = 90; private float rotation = 0; @@ -45,17 +46,17 @@ public class CannonHearth extends Entity { public void beforeUpdate(float delta) { if (cannon.health < 1) { if (rotation != 0 && cannon.health > 0) { - rotation = (rotation - delta * ROTATION_SPEED * cannon.team.speedMultiplier); + rotation = (rotation - delta * ROTATION_SPEED * cannon.team.speedMultiplier * cannon.getBoost()); if (rotation < 0) rotation = 0; } if (cannon.health == 0){ - rotation = (rotation - delta * ROTATION_SPEED * cannon.team.speedMultiplier); - if (rotation < 0) rotation += 45; + rotation = (rotation - delta * ROTATION_SPEED * cannon.team.speedMultiplier * cannon.getBoost()); + if (rotation < 0) rotation += ROTATION_MODULO; } } else { - rotation = (rotation - delta * ROTATION_SPEED * cannon.team.speedMultiplier); - if (rotation < 0) rotation += 45; + rotation = (rotation - delta * ROTATION_SPEED * cannon.team.speedMultiplier * cannon.getBoost()); + if (rotation < 0) rotation += ROTATION_MODULO; } }