Set CollisionDamage for Player and Enemies.
This commit is contained in:
parent
d444b36351
commit
0d90b387c3
|
@ -23,6 +23,7 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
||||||
this.setShootSpawn(50, 16);
|
this.setShootSpawn(50, 16);
|
||||||
this.setShootDirection(Shot.RIGHT);
|
this.setShootDirection(Shot.RIGHT);
|
||||||
this.setShootSpeed(10);
|
this.setShootSpeed(10);
|
||||||
|
this.setCollisionDamage(10);
|
||||||
this.setHealthPoints(100);
|
this.setHealthPoints(100);
|
||||||
this.registerOnKeyboard(Keyboard.getInstance());
|
this.registerOnKeyboard(Keyboard.getInstance());
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class EnemyFour extends Enemy{
|
||||||
this.setShootDelay(42);
|
this.setShootDelay(42);
|
||||||
this.setShootSpawn(-10, 10);
|
this.setShootSpawn(-10, 10);
|
||||||
this.setShootDamage(5);
|
this.setShootDamage(5);
|
||||||
|
this.setCollisionDamage(5);
|
||||||
this.setHealthPoints(5);
|
this.setHealthPoints(5);
|
||||||
this.points = points;
|
this.points = points;
|
||||||
this.x = x;
|
this.x = x;
|
||||||
|
|
|
@ -10,6 +10,7 @@ public class EnemyOne extends Enemy {
|
||||||
this.setShootDelay(42);
|
this.setShootDelay(42);
|
||||||
this.setShootSpawn(-8, 10);
|
this.setShootSpawn(-8, 10);
|
||||||
this.setShootDamage(5);
|
this.setShootDamage(5);
|
||||||
|
this.setCollisionDamage(5);
|
||||||
this.setHealthPoints(5);
|
this.setHealthPoints(5);
|
||||||
this.setCollisionDamage(this.getHealthPoints());
|
this.setCollisionDamage(this.getHealthPoints());
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class EnemyThree extends Enemy{
|
||||||
this.setShootSpawn(-10, 10);
|
this.setShootSpawn(-10, 10);
|
||||||
this.setShootDamage(5);
|
this.setShootDamage(5);
|
||||||
this.setHealthPoints(15);
|
this.setHealthPoints(15);
|
||||||
this.setCollisionDamage(this.getHealthPoints());
|
this.setCollisionDamage(10);
|
||||||
this.setPosition(GameConfig.windowWidth, random.nextInt(GameConfig.windowHeight - this.getHeight()));
|
this.setPosition(GameConfig.windowWidth, random.nextInt(GameConfig.windowHeight - this.getHeight()));
|
||||||
this.newY = this.getY();
|
this.newY = this.getY();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ public class EnemyTwo extends Enemy{
|
||||||
this.setShootDelay(42);
|
this.setShootDelay(42);
|
||||||
this.setShootSpawn(-10, 10);
|
this.setShootSpawn(-10, 10);
|
||||||
this.setShootDamage(5);
|
this.setShootDamage(5);
|
||||||
|
this.setCollisionDamage(5);
|
||||||
this.setHealthPoints(5);
|
this.setHealthPoints(5);
|
||||||
this.setCollisionDamage(this.getHealthPoints());
|
this.setCollisionDamage(this.getHealthPoints());
|
||||||
this.setPosition(GameConfig.windowWidth, random.nextInt(GameConfig.windowHeight - this.getHeight()));
|
this.setPosition(GameConfig.windowWidth, random.nextInt(GameConfig.windowHeight - this.getHeight()));
|
||||||
|
|
Loading…
Reference in New Issue