public class MobileEntity extends CollisionEntity implements IMobileEntity
ANY_MESSAGE
Constructor and Description |
---|
MobileEntity() |
Modifier and Type | Method and Description |
---|---|
int |
getAcceleration()
Gets a value that defines how long it takes the entity to reach the full
velocity (in ms).
|
int |
getDeceleration()
Gets a value that defines how long it takes the entity to stop when slowing down from movements (in ms).
|
java.awt.geom.Point2D |
getMoveDestination()
Gets the move destination.
|
IMovementController |
getMovementController()
Gets the movement controller.
|
float |
getTickVelocity()
Gets the entity's velocity in PIXELS per tick.
|
protected static float |
getTickVelocity(IMobileEntity entity) |
Attribute<java.lang.Float> |
getVelocity()
Gets the entity's velocity in PIXELS per Second.
|
void |
setAcceleration(int acceleration)
Sets the acceleration for this entity.
|
void |
setDeceleration(int deceleration)
Sets the deceleration for this entity.
|
void |
setLocation(java.awt.geom.Point2D position)
Sets the map location.
|
void |
setMoveDestination(java.awt.geom.Point2D dest)
Sets the point where the entity will be moved to.
|
void |
setTurnOnMove(boolean turn)
Sets the turn on move parameter for this entity.
|
void |
setVelocity(float velocity)
Sets the base value on the velocity attribute of this instance.
|
boolean |
turnOnMove()
Gets the turn on move parameter for this entity.
|
canCollideWith, getCollisionBox, getCollisionBox, getCollisionBox, getCollisionBoxAlign, getCollisionBoxCenter, getCollisionBoxHeight, getCollisionBoxValign, getCollisionBoxWidth, getCollisionType, hasCollision, setCollision, setCollisionBoxAlign, setCollisionBoxHeight, setCollisionBoxValign, setCollisionBoxWidth, setCollisionType, setHeight, setSize, setWidth
actions, addController, addListener, addMessageListener, addMessageListener, addTag, addTransformListener, attachControllers, detachControllers, getAngle, getAnimationController, getBehaviorController, getBoundingBox, getCenter, getController, getControllers, getEnvironment, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, isLoaded, loaded, perform, register, removed, removeListener, removeMessageListener, removeTag, removeTransformListener, renderWithLayer, sendMessage, setAngle, setController, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setX, setY, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canCollideWith, getCollisionBox, getCollisionBox, getCollisionBoxAlign, getCollisionBoxCenter, getCollisionBoxHeight, getCollisionBoxValign, getCollisionBoxWidth, getCollisionType, hasCollision, setCollision, setCollisionBoxAlign, setCollisionBoxHeight, setCollisionBoxValign, setCollisionBoxWidth, setCollisionType
actions, addController, addListener, addMessageListener, addMessageListener, addTag, addTransformListener, attachControllers, detachControllers, getAngle, getAnimationController, getBehaviorController, getBoundingBox, getCenter, getController, getEnvironment, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, isLoaded, loaded, perform, register, removed, removeListener, removeMessageListener, removeTag, removeTransformListener, renderWithLayer, sendMessage, setAngle, setController, setHeight, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setSize, setWidth, setX, setY
public int getAcceleration()
IMobileEntity
getAcceleration
in interface IMobileEntity
public int getDeceleration()
IMobileEntity
getDeceleration
in interface IMobileEntity
public java.awt.geom.Point2D getMoveDestination()
IMobileEntity
getMoveDestination
in interface IMobileEntity
public float getTickVelocity()
IMobileEntity
getTickVelocity
in interface IMobileEntity
public Attribute<java.lang.Float> getVelocity()
IMobileEntity
getVelocity
in interface IMobileEntity
public IMovementController getMovementController()
IMobileEntity
getMovementController
in interface IMobileEntity
public void setAcceleration(int acceleration)
IMobileEntity
setAcceleration
in interface IMobileEntity
acceleration
- the new accelerationpublic void setDeceleration(int deceleration)
IMobileEntity
setDeceleration
in interface IMobileEntity
deceleration
- the new decelerationpublic void setLocation(java.awt.geom.Point2D position)
Entity
setLocation
in interface IEntity
setLocation
in class CollisionEntity
position
- the new map locationpublic void setMoveDestination(java.awt.geom.Point2D dest)
IMobileEntity
setMoveDestination
in interface IMobileEntity
dest
- the destination point of the movement.public void setTurnOnMove(boolean turn)
IMobileEntity
setTurnOnMove
in interface IMobileEntity
turn
- the new turn on move parameter.public void setVelocity(float velocity)
IMobileEntity
setVelocity
in interface IMobileEntity
velocity
- The velocity to be set.IMobileEntity.getVelocity()
public boolean turnOnMove()
IMobileEntity
turnOnMove
in interface IMobileEntity
protected static float getTickVelocity(IMobileEntity entity)