|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjplay.Collision
public class Collision
Class used to know whether two GameObjects collided.
Constructor Summary | |
---|---|
Collision()
|
Method Summary | |
---|---|
static boolean |
collided(GameObject obj1,
GameObject obj2)
Static method used to know whether two GameObjects are touching each other. |
static boolean |
collided(java.awt.Point min1,
java.awt.Point max1,
java.awt.Point min2,
java.awt.Point max2)
Method used to know whether two areas on the screen are touching each other. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Collision()
Method Detail |
---|
public static boolean collided(java.awt.Point min1, java.awt.Point max1, java.awt.Point min2, java.awt.Point max2)
min1
- point of the top left of the first area.max1
- point from under of the right of the first image.min2
- point of the top left of the second area.max3
- point from under of the right of the second image.
public static boolean collided(GameObject obj1, GameObject obj2)
obj1
- origin GameObjectobj2
- target GameObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |