Deathanimation working
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package se.urmo.game.entities.ghost;
|
||||
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import se.urmo.game.collision.GhostCollisionChecker;
|
||||
import se.urmo.game.entities.BaseAnimated;
|
||||
@ -13,10 +14,8 @@ import se.urmo.game.map.GameMap;
|
||||
import se.urmo.game.state.GhostManager;
|
||||
import se.urmo.game.state.LevelManager;
|
||||
import se.urmo.game.util.Direction;
|
||||
import se.urmo.game.util.MiscUtil;
|
||||
import se.urmo.game.util.MyPoint;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Point;
|
||||
import java.awt.image.BufferedImage;
|
||||
@ -49,6 +48,8 @@ public class Ghost extends BaseAnimated {
|
||||
private final GhostStrategy fearStrategy = new FearStrategy();
|
||||
private int frightenedTimer = 0;
|
||||
private boolean isBlinking = false;
|
||||
@Setter
|
||||
private boolean frozen;
|
||||
|
||||
|
||||
public Ghost(GhostCollisionChecker collisionChecker, GhostStrategy strategy, GhostStrategy scaterStrategy, int animation, LevelManager levelManager) {
|
||||
@ -78,7 +79,7 @@ public class Ghost extends BaseAnimated {
|
||||
}
|
||||
|
||||
public void update(PacMan pacman, GameMap map) {
|
||||
//updateAnimationTick();
|
||||
if (frozen) return;
|
||||
if (mode == GhostMode.FRIGHTENED) {
|
||||
updateInFrightendMode();
|
||||
}
|
||||
@ -223,4 +224,5 @@ public class Ghost extends BaseAnimated {
|
||||
public void resetModes() {
|
||||
mode = GhostMode.CHASE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user