|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.engine.collision.CollisionManager
public abstract class CollisionManager
Collision Manager API This collision manager class is abstract and is intended to be extended by a subclass that specifies the mechanics for a specific game. It has built-in methods to process collisions between objects and between objects and borders
Constructor Summary | |
---|---|
CollisionManager()
|
Method Summary | |
---|---|
protected void |
act(Collidable object1,
Collidable object2)
Calls the actOnCollision method for each of the object involved in a collision. |
void |
collides(Collidable object1,
Collidable object2)
Process collisions between two objects. |
void |
collides(Collidable object1,
java.util.List<Collidable> listOfObjects)
Process collisions between an object and a list of objects. |
void |
collides(java.util.List<Collidable> listOfObjects)
Process collisions in a list objects. |
void |
collides(java.util.List<Collidable> list1,
java.util.List<Collidable> list2)
Process collision between two lists of objects. |
void |
processBorders(Collidable object,
double worldWidth,
double worldHeight)
Process border collisions for a given object. |
void |
processBorders(Collidable object,
double top,
double bottom,
double left,
double right)
Process border collisions for a given object. |
protected void |
processBottomBorder(Collidable object,
double bottom)
Process collision with bottom border. |
protected void |
processLeftBorder(Collidable object,
double left)
Process collision with left border. |
protected void |
processRightBorder(Collidable object,
double right)
Process collision with right border. |
protected void |
processTopBorder(Collidable object,
double top)
Process collision with top border. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollisionManager()
Method Detail |
---|
protected void act(Collidable object1, Collidable object2)
object1
- an object that implements the interface Collidableobject2
- an object that implements the interface Collidablepublic void collides(Collidable object1, Collidable object2)
object1
- an object that implements the interface Collidableobject2
- an object that implements the interface Collidablepublic void collides(Collidable object1, java.util.List<Collidable> listOfObjects)
object1
- an object that implements the interface CollidablelistOfObjects
- a list of Collidable objectspublic void collides(java.util.List<Collidable> listOfObjects)
listOfObjects
- a list of Collidable objectspublic void collides(java.util.List<Collidable> list1, java.util.List<Collidable> list2)
list1
- a list of Collidable objectslist2
- a list of Collidable objectspublic void processBorders(Collidable object, double worldWidth, double worldHeight)
object
- an object that implements the interface CollidableworldWidth
- width of the game worldworldHeight
- height of the game worldpublic void processBorders(Collidable object, double top, double bottom, double left, double right)
object
- an object that implements the interface Collidabletop
- location of the top border of the game worldbottom
- location of the bottom border of the game worldleft
- location of the left border of the game worldright
- location of the right border of the game worldprotected void processTopBorder(Collidable object, double top)
object
- an object that implements the interface Collidabletop
- location of the top border of the game worldprotected void processBottomBorder(Collidable object, double bottom)
object
- an object that implements the interface Collidablebottom
- location of the bottom border of the game worldprotected void processLeftBorder(Collidable object, double left)
object
- an object that implements the interface Collidableleft
- location of the left border of the game worldprotected void processRightBorder(Collidable object, double right)
object
- an object that implements the interface Collidableright
- location of the right border of the game world
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |