From ac97f95ca82cbb228812d35411081a5dc235d232 Mon Sep 17 00:00:00 2001 From: lubiana Date: Tue, 28 Oct 2014 13:44:09 +0100 Subject: [PATCH] Enemy angefangen, HP zu CollidableEntity geaddet --- .../spacescooter/entity/CollidableEntity.java | 10 ++++++++++ .../spacescooter/entity/Enemy.java | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/de/teamteamteam/spacescooter/entity/Enemy.java diff --git a/src/de/teamteamteam/spacescooter/entity/CollidableEntity.java b/src/de/teamteamteam/spacescooter/entity/CollidableEntity.java index 245f2ed..b0e6ea2 100644 --- a/src/de/teamteamteam/spacescooter/entity/CollidableEntity.java +++ b/src/de/teamteamteam/spacescooter/entity/CollidableEntity.java @@ -14,6 +14,16 @@ public abstract class CollidableEntity extends Entity { */ protected int width; protected int height; + + /** + * Health Points of the Object + */ + protected int heakthPoints; + + /** + * Shieldpoints of the Object + */ + protected int shieldPoints; public int getX() { diff --git a/src/de/teamteamteam/spacescooter/entity/Enemy.java b/src/de/teamteamteam/spacescooter/entity/Enemy.java new file mode 100644 index 0000000..4a25042 --- /dev/null +++ b/src/de/teamteamteam/spacescooter/entity/Enemy.java @@ -0,0 +1,20 @@ +package de.teamteamteam.spacescooter.entity; + +public abstract class Enemy extends CollidableEntity { + + protected String name; + protected boolean willShoot; + + @Override + public void update() { + if(willShoot) + this.shoot(); + } + + protected abstract void shoot(); + + + + +} +