From d9b7128456f9cafc2e3a9c805211ed6b6ef764f2 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Fri, 7 Nov 2014 20:47:07 +0100 Subject: [PATCH] Rename DamageValue to ShootDamage to avoid confusion with Shot logic. --- src/de/teamteamteam/spacescooter/entity/Player.java | 1 + .../spacescooter/entity/ShootingEntity.java | 12 ++++++------ .../spacescooter/entity/item/TestItem1.java | 2 +- .../spacescooter/entity/item/TestItem2.java | 2 +- .../spacescooter/entity/item/TestItem3.java | 2 +- .../spacescooter/entity/item/TestItem4.java | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/de/teamteamteam/spacescooter/entity/Player.java b/src/de/teamteamteam/spacescooter/entity/Player.java index 0ec5bbc..47ef7d1 100644 --- a/src/de/teamteamteam/spacescooter/entity/Player.java +++ b/src/de/teamteamteam/spacescooter/entity/Player.java @@ -18,6 +18,7 @@ public class Player extends ShootingEntity implements KeyboardListener { super(x, y); this.setImage("images/ship.png"); this.setPrimaryShotImage("images/shots/laser_blue.png"); + this.setShootDamage(5); this.setShootDelay(20); this.setShootSpawn(50, 16); this.setShootDirection(Shot.RIGHT); diff --git a/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java b/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java index d27c5bf..7b9b85f 100644 --- a/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/ShootingEntity.java @@ -47,7 +47,7 @@ public abstract class ShootingEntity extends LivingEntity { /** * The damage the fired Shots will cause. */ - private int damageValue; + private int shootDamage; /** * The speed the fired Shots will travel at. @@ -145,15 +145,15 @@ public abstract class ShootingEntity extends LivingEntity { /** * Set the damage value the fired shots will cause. */ - public void setDamageValue(int damageValue){ - this.damageValue = damageValue; + public void setShootDamage(int shootDamage){ + this.shootDamage = shootDamage; } /** * Get the current damage the fired shots will cause. */ - public int getDamageValue(){ - return this.damageValue; + public int getShootDamage(){ + return this.shootDamage; } /** @@ -173,7 +173,7 @@ public abstract class ShootingEntity extends LivingEntity { this.getY() + this.shootSpawnY, this.shootDirection, this.shootSpeed, - this.damageValue, + this.shootDamage, this.primaryShotImage ); } diff --git a/src/de/teamteamteam/spacescooter/entity/item/TestItem1.java b/src/de/teamteamteam/spacescooter/entity/item/TestItem1.java index 4f524ba..ad83bcd 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/TestItem1.java +++ b/src/de/teamteamteam/spacescooter/entity/item/TestItem1.java @@ -11,6 +11,6 @@ public class TestItem1 extends Items{ @Override public void itemCollected(Player player) { - player.setDamageValue(player.getDamageValue()+5); + player.setShootDamage(player.getShootDamage()+5); } } diff --git a/src/de/teamteamteam/spacescooter/entity/item/TestItem2.java b/src/de/teamteamteam/spacescooter/entity/item/TestItem2.java index 0e4fbab..c1eea28 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/TestItem2.java +++ b/src/de/teamteamteam/spacescooter/entity/item/TestItem2.java @@ -13,6 +13,6 @@ public class TestItem2 extends Items{ @Override public void itemCollected(Player player) { - player.setDamageValue(player.getDamageValue()+5); + player.setShootDamage(player.getShootDamage()+5); } } diff --git a/src/de/teamteamteam/spacescooter/entity/item/TestItem3.java b/src/de/teamteamteam/spacescooter/entity/item/TestItem3.java index 504f818..25e46a5 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/TestItem3.java +++ b/src/de/teamteamteam/spacescooter/entity/item/TestItem3.java @@ -13,6 +13,6 @@ public class TestItem3 extends Items{ @Override public void itemCollected(Player player) { - player.setDamageValue(player.getDamageValue()+5); + player.setShootDamage(player.getShootDamage()+5); } } diff --git a/src/de/teamteamteam/spacescooter/entity/item/TestItem4.java b/src/de/teamteamteam/spacescooter/entity/item/TestItem4.java index 943a4d7..ed0ab14 100644 --- a/src/de/teamteamteam/spacescooter/entity/item/TestItem4.java +++ b/src/de/teamteamteam/spacescooter/entity/item/TestItem4.java @@ -13,6 +13,6 @@ public class TestItem4 extends Items{ @Override public void itemCollected(Player player) { - player.setDamageValue(player.getDamageValue()+5); + player.setShootDamage(player.getShootDamage()+5); } }