public abstract class EntityPlatform
extends com.b3dgs.lionengine.game.entity.EntityGame
implements com.b3dgs.lionengine.anim.Animator
Constructor and Description |
---|
EntityPlatform(com.b3dgs.lionengine.game.SetupSurfaceGame setup)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
applyHorizontalCollision(java.lang.Double x)
Apply an horizontal collision using the specified blocking x value.
|
boolean |
applyVerticalCollision(java.lang.Double y)
Apply a vertical collision using the specified blocking y value.
|
com.b3dgs.lionengine.anim.AnimState |
getAnimState() |
<C extends java.lang.Enum<C>,T extends TilePlatform<C>,M extends MapTilePlatform<C,T>> |
getCollisionTile(M map,
CollisionTileCategory<C> category)
Get the first tile hit for the specified collision tile category matching the collision list.
|
double |
getDiffHorizontal()
Get real horizontal speed (calculated on differential location x).
|
double |
getDiffVertical()
Get real vertical speed (calculated on differential location y).
|
int |
getFrame() |
int |
getFrameAnim() |
int |
getLocationIntX() |
int |
getLocationIntY() |
double |
getLocationOldX() |
double |
getLocationOldY() |
double |
getLocationX() |
double |
getLocationY() |
boolean |
isGoingDown()
Check if entity is going down.
|
boolean |
isGoingUp()
Check if entity is going up.
|
void |
play(com.b3dgs.lionengine.anim.Animation anim) |
void |
render(com.b3dgs.lionengine.Graphic g,
CameraPlatform camera)
Render on screen.
|
void |
renderAnim(com.b3dgs.lionengine.Graphic g,
com.b3dgs.lionengine.drawable.SpriteAnimated sprite,
CameraPlatform camera)
Render an animated sprite from the entity location, following camera view point.
|
void |
renderAnim(com.b3dgs.lionengine.Graphic g,
com.b3dgs.lionengine.drawable.SpriteAnimated sprite,
CameraPlatform camera,
int rx,
int ry)
Render an animated sprite from the entity location, following camera view point.
|
void |
setAnimSpeed(double speed) |
void |
setFrame(int frame) |
void |
setFrameOffsets(int frameOffsetX,
int frameOffsetY)
Set frame offsets (offsets on rendering).
|
void |
stopAnimation() |
void |
teleport(double x,
double y) |
void |
teleportX(double x) |
void |
teleportY(double y) |
void |
update(double extrp)
Main update routine.
|
void |
updateAnimation(double extrp) |
void |
updateMirror() |
collide, collide, getCollisionBounds, getCollisionData, getCollisionRay, getDistance, getHeight, getLocationOffsetX, getLocationOffsetY, getMass, getMirror, getMirrorCancel, getWeight, getWidth, invertAxisY, mirror, moveLocation, moveLocation, renderCollision, resetGravity, setCollision, setGravityMax, setLocation, setLocationOffset, setLocationX, setLocationY, setMass, setMirrorCancel, setSize, updateCollision, updateGravity
public EntityPlatform(com.b3dgs.lionengine.game.SetupSurfaceGame setup)
It needs in its config file the frame description:
<entity>
<frames horizontal="" vertical=""/>
<size width="" height=""/>
</entity>
setup
- The entity setup.public void render(com.b3dgs.lionengine.Graphic g, CameraPlatform camera)
g
- The graphic output.camera
- The camera viewpoint.public void setFrameOffsets(int frameOffsetX, int frameOffsetY)
frameOffsetX
- The horizontal offset.frameOffsetY
- The vertical offset.public double getDiffHorizontal()
public double getDiffVertical()
public boolean isGoingUp()
true
if going up, false
else.public boolean isGoingDown()
true
if going down, false
else.public boolean applyHorizontalCollision(java.lang.Double x)
x
- The blocking x value.true
if collision where applied.public boolean applyVerticalCollision(java.lang.Double y)
y
- The blocking y value.true
if collision where applied.public void renderAnim(com.b3dgs.lionengine.Graphic g, com.b3dgs.lionengine.drawable.SpriteAnimated sprite, CameraPlatform camera)
g
- The graphics output.sprite
- The sprite to render.camera
- The camera reference.public void renderAnim(com.b3dgs.lionengine.Graphic g, com.b3dgs.lionengine.drawable.SpriteAnimated sprite, CameraPlatform camera, int rx, int ry)
g
- The graphics output.sprite
- The sprite to render.camera
- The camera reference.rx
- The horizontal rendering offset.ry
- The vertical rendering offset.public <C extends java.lang.Enum<C>,T extends TilePlatform<C>,M extends MapTilePlatform<C,T>> T getCollisionTile(M map, CollisionTileCategory<C> category)
map
- The map reference.category
- The collision tile category.null
if none.public void update(double extrp)
update
in class com.b3dgs.lionengine.game.entity.EntityGame
extrp
- The extrapolation value.public void updateMirror()
updateMirror
in interface com.b3dgs.lionengine.game.purview.Mirrorable
updateMirror
in class com.b3dgs.lionengine.game.entity.EntityGame
public double getLocationX()
getLocationX
in interface com.b3dgs.lionengine.game.purview.Localizable
getLocationX
in class com.b3dgs.lionengine.game.entity.EntityGame
public double getLocationY()
getLocationY
in interface com.b3dgs.lionengine.game.purview.Localizable
getLocationY
in class com.b3dgs.lionengine.game.entity.EntityGame
public double getLocationOldX()
getLocationOldX
in interface com.b3dgs.lionengine.game.purview.Localizable
getLocationOldX
in class com.b3dgs.lionengine.game.entity.EntityGame
public double getLocationOldY()
getLocationOldY
in interface com.b3dgs.lionengine.game.purview.Localizable
getLocationOldY
in class com.b3dgs.lionengine.game.entity.EntityGame
public int getLocationIntX()
getLocationIntX
in interface com.b3dgs.lionengine.game.Surface
getLocationIntX
in class com.b3dgs.lionengine.game.entity.EntityGame
public int getLocationIntY()
getLocationIntY
in interface com.b3dgs.lionengine.game.Surface
getLocationIntY
in class com.b3dgs.lionengine.game.entity.EntityGame
public void teleport(double x, double y)
teleport
in interface com.b3dgs.lionengine.game.purview.Localizable
teleport
in class com.b3dgs.lionengine.game.entity.EntityGame
public void teleportX(double x)
teleportX
in interface com.b3dgs.lionengine.game.purview.Localizable
teleportX
in class com.b3dgs.lionengine.game.entity.EntityGame
public void teleportY(double y)
teleportY
in interface com.b3dgs.lionengine.game.purview.Localizable
teleportY
in class com.b3dgs.lionengine.game.entity.EntityGame
public void play(com.b3dgs.lionengine.anim.Animation anim)
play
in interface com.b3dgs.lionengine.anim.Animator
public void setAnimSpeed(double speed)
setAnimSpeed
in interface com.b3dgs.lionengine.anim.Animator
public void updateAnimation(double extrp)
updateAnimation
in interface com.b3dgs.lionengine.anim.Animator
public int getFrame()
getFrame
in interface com.b3dgs.lionengine.anim.Animator
public int getFrameAnim()
getFrameAnim
in interface com.b3dgs.lionengine.anim.Animator
public void stopAnimation()
stopAnimation
in interface com.b3dgs.lionengine.anim.Animator
public com.b3dgs.lionengine.anim.AnimState getAnimState()
getAnimState
in interface com.b3dgs.lionengine.anim.Animator
public void setFrame(int frame)
setFrame
in interface com.b3dgs.lionengine.anim.Animator