-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInternalTile.java
More file actions
29 lines (25 loc) · 827 Bytes
/
Copy pathInternalTile.java
File metadata and controls
29 lines (25 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* InternalTile mainly used for pathfinding for Undead. By itself, it does not do much.
*
* @author Jacky161
* @version v1.0-public
*/
public class InternalTile extends Actor
{
/** Internal Variables */
private final int X;
private final int Y;
/** Constructor for InternalTile. */
public InternalTile(boolean debug, int x, int y) {
this.X = x;
this.Y = y;
// Debug mode leaves tiles visible in the world
if (debug) return;
setImage("InternalTileTransparent.png");
}
/** Act method to ensure the tile cannot be dragged and moved while game is not running. */
public void act() {
if (getX() != X || getY() != Y) setLocation(X, Y);
}
}