package dungeonmania.entities.enemies;
import dungeonmania.Game;
import dungeonmania.battles.BattleStatistics;
Copyright By Assignmentchef assignmentchef
import dungeonmania.battles.Battleable;
import dungeonmania.entities.Entity;
import dungeonmania.entities.Player;
import dungeonmania.map.GameMap;
import dungeonmania.util.Position;
public abstract class Enemy extends Entity implements Battleable {
private BattleStatistics battleStatistics;
public Enemy(Position position, double health, double attack) {
super(position.asLayer(Entity.CHARACTER_LAYER));
battleStatistics = new BattleStatistics(
BattleStatistics.DEFAULT_DAMAGE_MAGNIFIER,
BattleStatistics.DEFAULT_ENEMY_DAMAGE_REDUCER);
public boolean canMoveOnto(GameMap map, Entity entity) {
return entity instanceof Player;
public BattleStatistics getBattleStatistics() {
return battleStatistics;
public void onOverlap(GameMap map, Entity entity) {
if (entity instanceof Player) {
Player player = (Player) entity;
map.getGame().battle(player, this);
public void onDestroy(GameMap map) {
Game g = map.getGame();
g.unsubscribe(getId());
public void onMovedAway(GameMap map, Entity entity) {
public abstract void move(Game game);
CS: assignmentchef QQ: 1823890830 Email: [email protected]
Reviews
There are no reviews yet.