Package zombie
Class WallFollower
java.lang.Object
zombie.WallFollower
public class WallFollower
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description int
blockedNextX
int
blockedNextY
int
curX
int
curY
int
endX
int
endY
boolean
failed
int
followStartHitCount
int
followStartX
int
followStartY
int
followSteps
static WallFollower
instance
static int
MAX_PATH_LEN
boolean
noPath
int[]
path
int
pathLen
int
startX
int
startY
static int
STATUS_FAILED
static int
STATUS_NO_PATH
static int
STATUS_RUNNING
static int
STATUS_SUCCESS
-
Constructor Summary
Constructors Constructor Description WallFollower()
-
Method Summary
Modifier and Type Method Description void
assaultPlayer()
void
directStep()
void
initPath(int sx, int sy, int ex, int ey)
boolean
isBlocked(int x, int y)
boolean
isBlocked(int x1, int y1, int x2, int y2)
boolean
isBlockedN(int x, int y)
boolean
isBlockedW(int x, int y)
boolean
isPointOnLine(int x, int y)
void
mouseMove(int x, int y)
void
renderDebugOverhead2(float zoom)
void
setEndXY(int x, int y)
void
setStartXY(int x, int y)
int
update()
void
wallStep()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
instance
-
startX
public int startX -
startY
public int startY -
endX
public int endX -
endY
public int endY -
followStartX
public int followStartX -
followStartY
public int followStartY -
followSteps
public int followSteps -
followStartHitCount
public int followStartHitCount -
blockedNextX
public int blockedNextX -
blockedNextY
public int blockedNextY -
curX
public int curX -
curY
public int curY -
failed
public boolean failed -
noPath
public boolean noPath -
MAX_PATH_LEN
public static final int MAX_PATH_LEN- See Also:
- Constant Field Values
-
path
public int[] path -
pathLen
public int pathLen -
STATUS_RUNNING
public static final int STATUS_RUNNING- See Also:
- Constant Field Values
-
STATUS_FAILED
public static final int STATUS_FAILED- See Also:
- Constant Field Values
-
STATUS_NO_PATH
public static final int STATUS_NO_PATH- See Also:
- Constant Field Values
-
STATUS_SUCCESS
public static final int STATUS_SUCCESS- See Also:
- Constant Field Values
-
-
Constructor Details
-
WallFollower
public WallFollower()
-
-
Method Details
-
initPath
public void initPath(int sx, int sy, int ex, int ey) -
isBlocked
public boolean isBlocked(int x, int y) -
isBlocked
public boolean isBlocked(int x1, int y1, int x2, int y2) -
isBlockedN
public boolean isBlockedN(int x, int y) -
isBlockedW
public boolean isBlockedW(int x, int y) -
isPointOnLine
public boolean isPointOnLine(int x, int y) -
wallStep
public void wallStep() -
directStep
public void directStep() -
update
public int update() -
setStartXY
public void setStartXY(int x, int y) -
setEndXY
public void setEndXY(int x, int y) -
mouseMove
public void mouseMove(int x, int y) -
renderDebugOverhead2
public void renderDebugOverhead2(float zoom) -
assaultPlayer
public void assaultPlayer()
-