|
GTGE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CollisionShape
CollisionShape
interface represents a form of geometric shape
that behave as sprite collision area. CollisionShape
is able to
determine whether its area is intersected with another collision shape area.
This interface that play the role to determine whether two sprites are
collided to each other or not using CollisionShape
intersects(CollisionShape) method.
Method Summary | |
---|---|
int |
getHeight()
Returns the height of this collision shape. |
int |
getWidth()
Returns the width of this collision shape. |
double |
getX()
Returns the x -position of this collision shape. |
double |
getY()
Returns the y -position of this collision shape. |
boolean |
intersects(CollisionShape shape)
Returns whether this collision shape intersects with other collision shape area. |
void |
move(double dx,
double dy)
Moves this collision shape by specified delta. |
void |
setBounds(double x1,
double y1,
int w1,
int h1)
Sets the boundary of this colllision shape to specified boundary. |
void |
setLocation(double x,
double y)
Moves this collision shape to specified location. |
Method Detail |
---|
boolean intersects(CollisionShape shape)
void setLocation(double x, double y)
void move(double dx, double dy)
void setBounds(double x1, double y1, int w1, int h1)
double getX()
x
-position of this collision shape.
double getY()
y
-position of this collision shape.
int getWidth()
int getHeight()
|
GTGE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |