Class republikensoft.Obstacle
All Packages Class Hierarchy This Package Previous Next Index
Class republikensoft.Obstacle
java.lang.Object
|
+----republikensoft.Obstacle
- public class Obstacle
- extends Object
Instances of this class are ammo boxes and rocks.
Trees extends this class.
- See Also:
- Tree
-
Obstacle(Image, int, int, Polygon)
-
-
draw(Graphics)
- Draws the obstacle.
-
getCentre()
-
-
getPolygon()
-
-
helpPoly(int)
-
Obstacle
public Obstacle(Image t,
int x,
int y,
Polygon p)
- Parameters:
- t - texture with which the obstacle is drawn.
- x - x-coordinate
- y - y-coordinate
- p - the border of the obstacle.
draw
public void draw(Graphics g)
- Draws the obstacle.
Can also draw the help polygons for collision detection.
See Obstacle.java for more details.
getPolygon
public Polygon getPolygon()
- Returns:
- the polygon that defines the border of the obstacle.
getCentre
public Point getCentre()
- Returns:
- centre of the obstacle.
helpPoly
public Polygon helpPoly(int i)
- Parameters:
- i - which point a help polygon is wanted for
- Returns:
- help polygon for point i and i+1
All Packages Class Hierarchy This Package Previous Next Index