public abstract class CollisionEntity extends Entity implements ICollisionEntity
ANY_MESSAGE| Modifier | Constructor and Description |
|---|---|
protected |
CollisionEntity() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCollideWith(ICollisionEntity otherEntity) |
void |
fireCollisionEvent(CollisionEvent event) |
java.awt.geom.Rectangle2D |
getCollisionBox()
Gets the collision box.
|
java.awt.geom.Rectangle2D |
getCollisionBox(java.awt.geom.Point2D location)
Gets the collision box.
|
static java.awt.geom.Rectangle2D |
getCollisionBox(java.awt.geom.Point2D location,
double entityWidth,
double entityHeight,
double collisionBoxWidth,
double collisionBoxHeight,
Align align,
Valign valign) |
Align |
getCollisionBoxAlign() |
java.awt.geom.Point2D |
getCollisionBoxCenter()
Gets the center
Point2D of the entities collision box. |
double |
getCollisionBoxHeight() |
Valign |
getCollisionBoxValign() |
double |
getCollisionBoxWidth() |
Collision |
getCollisionType() |
boolean |
hasCollision()
Checks for collision.
|
void |
onCollision(CollisionListener listener) |
void |
removeCollisionListener(CollisionListener listener) |
void |
setCollision(boolean collision)
Sets the collision.
|
void |
setCollisionBoxAlign(Align align) |
void |
setCollisionBoxHeight(double collisionBoxHeight) |
void |
setCollisionBoxValign(Valign valign) |
void |
setCollisionBoxWidth(double collisionBoxWidth) |
void |
setCollisionType(Collision type) |
void |
setHeight(double height) |
void |
setLocation(java.awt.geom.Point2D location)
Sets the map location.
|
void |
setSize(double width,
double height) |
void |
setWidth(double width) |
actions, addController, addEntityRenderListener, addListener, addTag, addTransformListener, animations, attachControllers, behavior, canRender, detachControllers, getAngle, getBoundingBox, getCenter, getController, getControllers, getEnvironment, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, isLoaded, isVisible, loaded, onMessage, onMessage, onRendered, perform, register, removed, removeEntityRenderedListener, removeEntityRenderListener, removeListener, removeMessageListener, removeTag, removeTransformListener, rendered, rendering, renderWithLayer, sendMessage, setAngle, setController, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setVisible, setX, setY, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitactions, addController, addEntityRenderListener, addListener, addTag, addTransformListener, animations, attachControllers, behavior, detachControllers, getAngle, getBoundingBox, getCenter, getController, getEnvironment, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, isLoaded, isVisible, loaded, onMessage, onMessage, onRendered, perform, register, removed, removeEntityRenderedListener, removeEntityRenderListener, removeListener, removeMessageListener, removeTag, removeTransformListener, renderWithLayer, sendMessage, setAngle, setController, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setVisible, setX, setYpublic static java.awt.geom.Rectangle2D getCollisionBox(java.awt.geom.Point2D location,
double entityWidth,
double entityHeight,
double collisionBoxWidth,
double collisionBoxHeight,
Align align,
Valign valign)
public boolean canCollideWith(ICollisionEntity otherEntity)
canCollideWith in interface ICollisionEntitypublic Align getCollisionBoxAlign()
getCollisionBoxAlign in interface ICollisionEntitypublic java.awt.geom.Rectangle2D getCollisionBox()
getCollisionBox in interface ICollisionEntitypublic java.awt.geom.Rectangle2D getCollisionBox(java.awt.geom.Point2D location)
getCollisionBox in interface ICollisionEntitylocation - the locationpublic double getCollisionBoxHeight()
getCollisionBoxHeight in interface ICollisionEntitypublic double getCollisionBoxWidth()
getCollisionBoxWidth in interface ICollisionEntitypublic java.awt.geom.Point2D getCollisionBoxCenter()
ICollisionEntityPoint2D of the entities collision box.getCollisionBoxCenter in interface ICollisionEntityPoint2D of the entities collision boxpublic Valign getCollisionBoxValign()
getCollisionBoxValign in interface ICollisionEntitypublic Collision getCollisionType()
getCollisionType in interface ICollisionEntitypublic boolean hasCollision()
hasCollision in interface ICollisionEntitypublic void setCollision(boolean collision)
setCollision in interface ICollisionEntitycollision - the new collisionpublic void setCollisionBoxAlign(Align align)
setCollisionBoxAlign in interface ICollisionEntitypublic void setCollisionBoxHeight(double collisionBoxHeight)
setCollisionBoxHeight in interface ICollisionEntitypublic void setCollisionBoxValign(Valign valign)
setCollisionBoxValign in interface ICollisionEntitypublic void setCollisionBoxWidth(double collisionBoxWidth)
setCollisionBoxWidth in interface ICollisionEntitypublic void setLocation(java.awt.geom.Point2D location)
EntitysetLocation in interface IEntitysetLocation in class Entitylocation - the new map locationpublic void setSize(double width,
double height)
public void setHeight(double height)
public void setWidth(double width)
public void setCollisionType(Collision type)
setCollisionType in interface ICollisionEntitypublic void onCollision(CollisionListener listener)
onCollision in interface ICollisionEntitypublic void removeCollisionListener(CollisionListener listener)
removeCollisionListener in interface ICollisionEntitypublic void fireCollisionEvent(CollisionEvent event)
fireCollisionEvent in interface ICollisionEntity