I'm currently working on a game and the problem I am having is when my player is done killing the Enemy that is currently in combat attack animation for the player seems to speed up or gitter for the next Enemy that its killing. I'm not sure how I can set "player.attacking" = false without it doing this.
for (Player p : CastleGame.gameHandler.player) {
if (p != null) {
distance = ((int)x - (int)p.getX());
if (!isDead() && distance == getMobDistance()) {
p.setDirX(0);
setDirX(0);
p.attacking = true;
}
if (isDead()) {
//p.attacking = false;
setDirX(0);
removeDead--;
if (removeDead <= 0) {
removeDead = 0;
CastleGame.gameHandler.removeMonster(this);
}
}
}
}