apes
Class Block

java.lang.Object
  extended by apes.Block
All Implemented Interfaces:
ICollidableObject

public class Block
extends java.lang.Object
implements ICollidableObject

This class is a simple block (rectangle) implementation of ICollidableObject.


Field Summary
 org.newdawn.slick.geom.Polygon poly
           
 
Constructor Summary
Block(int x, int y, int width, int higth)
          constructs a new block.
 
Method Summary
 void draw(org.newdawn.slick.Graphics g)
          calls the draw method of Graphics with the polygon residing in this class.
 org.newdawn.slick.geom.Shape getCollisionShape()
          returns the collision shape of this object moved to its actual position.
 org.newdawn.slick.geom.Shape getNormalCollisionShape()
          returns the general collision shape of this object.
 boolean isCollidingWith(ICollidableObject collidable)
          checks weather or not this object is colliding with the provided object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

poly

public org.newdawn.slick.geom.Polygon poly
Constructor Detail

Block

public Block(int x,
             int y,
             int width,
             int higth)
constructs a new block. Its position will be defined by the given x and y values and its width and higth by the provided values as well.

Parameters:
x -
y -
width -
higth -
Method Detail

getCollisionShape

public org.newdawn.slick.geom.Shape getCollisionShape()
Description copied from interface: ICollidableObject
returns the collision shape of this object moved to its actual position.

Specified by:
getCollisionShape in interface ICollidableObject
Returns:

getNormalCollisionShape

public org.newdawn.slick.geom.Shape getNormalCollisionShape()
Description copied from interface: ICollidableObject
returns the general collision shape of this object.

Specified by:
getNormalCollisionShape in interface ICollidableObject
Returns:

isCollidingWith

public boolean isCollidingWith(ICollidableObject collidable)
Description copied from interface: ICollidableObject
checks weather or not this object is colliding with the provided object.

Specified by:
isCollidingWith in interface ICollidableObject
Returns:

draw

public void draw(org.newdawn.slick.Graphics g)
calls the draw method of Graphics with the polygon residing in this class.

Parameters:
g -