From fc87ef9da80a1857a621eb304176c875c6f7042c Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 2 Dec 2014 11:53:11 +0100 Subject: [PATCH] Rename damagable to vulnerable so they can be distinguished easily. --- .../spacescooter/entity/LivingEntity.java | 14 +++++++------- .../teamteamteam/spacescooter/entity/Player.java | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/entity/LivingEntity.java b/src/de/teamteamteam/spacescooter/entity/LivingEntity.java index 9def9ea..048cf4b 100644 --- a/src/de/teamteamteam/spacescooter/entity/LivingEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/LivingEntity.java @@ -45,7 +45,7 @@ public abstract class LivingEntity extends CollidableEntity implements Hittable /** * Whether the LivingEntity will take damage. */ - private boolean damagable; + private boolean vulnerable; /** @@ -53,7 +53,7 @@ public abstract class LivingEntity extends CollidableEntity implements Hittable */ public LivingEntity(int x, int y) { super(x, y); - this.setDamagable(true); + this.setVulnerable(true); } /** @@ -243,19 +243,19 @@ public abstract class LivingEntity extends CollidableEntity implements Hittable } /** - * Set whether the LivingEntity is damagable. + * Set whether the LivingEntity is vulnerable. * This defaults to true on construction and will only be changed manually. */ - public void setDamagable(boolean damagable) { - this.damagable = damagable; + public void setVulnerable(boolean vulnerable) { + this.vulnerable = vulnerable; } /** - * Whether or not the LivingEntity is damagable. + * Whether or not the LivingEntity is vulnerable. * This defaults to true on construction and will only be changed manually. */ public boolean getVulnerable() { - return this.damagable; + return this.vulnerable; } } diff --git a/src/de/teamteamteam/spacescooter/entity/Player.java b/src/de/teamteamteam/spacescooter/entity/Player.java index 8cb2e20..c979bf0 100644 --- a/src/de/teamteamteam/spacescooter/entity/Player.java +++ b/src/de/teamteamteam/spacescooter/entity/Player.java @@ -91,7 +91,7 @@ public class Player extends ShootingEntity implements KeyboardListener { if(this.currentCollisionCooldown > 0) { this.currentCollisionCooldown--; } else { - this.setDamagable(true); + this.setVulnerable(true); this.setDamaging(true); } int offset = 3; @@ -139,7 +139,7 @@ public class Player extends ShootingEntity implements KeyboardListener { super.collideWith(entity); if(this.currentCollisionCooldown == 0 && (entity instanceof Enemy || entity instanceof Obstacle)) { this.currentCollisionCooldown = this.collisionCooldown; - this.setDamagable(false); + this.setVulnerable(false); this.setDamaging(false); } }