com.b3dgs.lionengine.game.purviews
Interface Collisionable

All Known Implementing Classes:
AbstractBuilding, AbstractEnemy, AbstractEntity, AbstractEntry, AbstractHero, AbstractPlatformEntity, AbstractRasteredPlatformEntity, AbstractUnit, Entity, Projectile

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

updateCollision

void updateCollision(int x,
                     int y,
                     int width,
                     int height)
Update collision with specified area.

Parameters:
x - horizontal offset from entity.
y - vertical offset from entity.
width - entity collision width.
height - entity collision height.

collide

boolean collide(Entity entity)
Check if the entity entered in collision with another one.

Parameters:
entity - opponent.
Returns:
true if collide.

collide

boolean collide(java.awt.geom.Rectangle2D area)
Check if the entity entered in collision with a specified area.

Parameters:
area - area to check.
Returns:
true if collide.

invertYAxis

void invertYAxis(boolean invert)
Invert Y axis (recommended in case of platform game.

Parameters:
invert - inversion state.

renderCollision

void renderCollision(java.awt.Graphics2D g,
                     Camera camera)
Render collision bounding box.

Parameters:
g - graphics output.
camera - camera reference.

getCollision

java.awt.geom.Rectangle2D getCollision()
Get collision representation.

Returns:
collision representation.

getRay

java.awt.geom.Line2D getRay()
Get collision ray cast.

Returns:
collision ray cast.