-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFence.java
More file actions
28 lines (24 loc) · 747 Bytes
/
Copy pathFence.java
File metadata and controls
28 lines (24 loc) · 747 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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* In game fence object.
*
* @author Jacky161
* @version v1.0-public
*/
public class Fence extends Actor {
GreenfootImage fenceImg;
public Fence() {
this(0);
}
/** Constructor for fence, scales image and turns it to face the proper direction */
public Fence(int turnNum) {
fenceImg = getImage();
ExtendedActor.scaleImage(fenceImg, 1.3);
turn(turnNum);
}
/** Gets the InternalTile that the fence is colliding with */
public InternalTile getIntersectingTile() {
InternalTile tile = (InternalTile) getOneIntersectingObject(InternalTile.class);
return tile;
}
}