|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Collisionable
Purview representing something which can enter in collision with another object. Based on a ray casting collision.
Method Summary | |
---|---|
boolean |
collide(Entity entity)
Check if the entity entered in collision with another one. |
boolean |
collide(java.awt.geom.Rectangle2D area)
Check if the entity entered in collision with a specified area. |
java.awt.geom.Rectangle2D |
getCollision()
Get collision representation. |
java.awt.geom.Line2D |
getRay()
Get collision ray cast. |
void |
invertYAxis(boolean invert)
Invert Y axis (recommended in case of platform game. |
void |
renderCollision(java.awt.Graphics2D g,
Camera camera)
Render collision bounding box. |
void |
updateCollision(int x,
int y,
int width,
int height)
Update collision with specified area. |
Method Detail |
---|
void updateCollision(int x, int y, int width, int height)
x
- horizontal offset from entity.y
- vertical offset from entity.width
- entity collision width.height
- entity collision height.boolean collide(Entity entity)
entity
- opponent.
boolean collide(java.awt.geom.Rectangle2D area)
area
- area to check.
void invertYAxis(boolean invert)
invert
- inversion state.void renderCollision(java.awt.Graphics2D g, Camera camera)
g
- graphics output.camera
- camera reference.java.awt.geom.Rectangle2D getCollision()
java.awt.geom.Line2D getRay()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |