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

Constructor Index

 o Obstacle(Image, int, int, Polygon)

Method Index

 o draw(Graphics)
Draws the obstacle.
 o getCentre()
 o getPolygon()
 o helpPoly(int)

Constructors

 o 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.

Methods

 o draw
  public void draw(Graphics g)
Draws the obstacle. Can also draw the help polygons for collision detection. See Obstacle.java for more details.
 o getPolygon
  public Polygon getPolygon()
Returns:
the polygon that defines the border of the obstacle.
 o getCentre
  public Point getCentre()
Returns:
centre of the obstacle.
 o 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