Rename DamageValue to ShootDamage to avoid confusion with Shot logic.

This commit is contained in:
Jan Philipp Timme 2014-11-07 20:47:07 +01:00
parent 3c5e96791b
commit d9b7128456
6 changed files with 11 additions and 10 deletions

View File

@ -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);

View File

@ -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
);
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}