Set CollisionDamage for Player and Enemies.

This commit is contained in:
Jan Philipp Timme 2014-11-08 15:19:44 +01:00
parent d444b36351
commit 0d90b387c3
5 changed files with 5 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

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