Rename damagable to vulnerable so they can be distinguished easily.
This commit is contained in:
parent
bc68de5b99
commit
fc87ef9da8
@ -45,7 +45,7 @@ public abstract class LivingEntity extends CollidableEntity implements Hittable
|
|||||||
/**
|
/**
|
||||||
* Whether the LivingEntity will take damage.
|
* 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) {
|
public LivingEntity(int x, int y) {
|
||||||
super(x, 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.
|
* This defaults to true on construction and will only be changed manually.
|
||||||
*/
|
*/
|
||||||
public void setDamagable(boolean damagable) {
|
public void setVulnerable(boolean vulnerable) {
|
||||||
this.damagable = damagable;
|
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.
|
* This defaults to true on construction and will only be changed manually.
|
||||||
*/
|
*/
|
||||||
public boolean getVulnerable() {
|
public boolean getVulnerable() {
|
||||||
return this.damagable;
|
return this.vulnerable;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
|||||||
if(this.currentCollisionCooldown > 0) {
|
if(this.currentCollisionCooldown > 0) {
|
||||||
this.currentCollisionCooldown--;
|
this.currentCollisionCooldown--;
|
||||||
} else {
|
} else {
|
||||||
this.setDamagable(true);
|
this.setVulnerable(true);
|
||||||
this.setDamaging(true);
|
this.setDamaging(true);
|
||||||
}
|
}
|
||||||
int offset = 3;
|
int offset = 3;
|
||||||
@ -139,7 +139,7 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
|||||||
super.collideWith(entity);
|
super.collideWith(entity);
|
||||||
if(this.currentCollisionCooldown == 0 && (entity instanceof Enemy || entity instanceof Obstacle)) {
|
if(this.currentCollisionCooldown == 0 && (entity instanceof Enemy || entity instanceof Obstacle)) {
|
||||||
this.currentCollisionCooldown = this.collisionCooldown;
|
this.currentCollisionCooldown = this.collisionCooldown;
|
||||||
this.setDamagable(false);
|
this.setVulnerable(false);
|
||||||
this.setDamaging(false);
|
this.setDamaging(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user