public class AnimObject extends GameObject
Constructor and Description |
---|
AnimObject(java.io.InputStream is,
java.lang.String ref,
boolean flipped,
int fWidth,
int fHeight)
Animated object constructor
|
Modifier and Type | Method and Description |
---|---|
void |
castAnim(boolean loop)
Start casting animation
|
void |
draw(float x,
float y)
Draws object
|
Sprite |
getCurrentSprite()
Return texture of current sprite
|
int |
getDirection()
Returns object direction
|
void |
goDown()
Turns object down
|
void |
goLeft()
Turns object left
|
void |
goRight()
Turns object right
|
void |
goUp()
Turns object up
|
boolean |
isAnimStopped()
Checks if animation is stopped
|
void |
kneel(boolean kneelReq) |
void |
lie(boolean lieReq)
Sets object lie position on or off
|
void |
meleeAnim(boolean loop)
Starts melee attack animation
|
void |
move(boolean move)
Switches object move animation
|
void |
rangeAnim(boolean loop)
Starts range attack animation
|
void |
reset()
Stops all anims and resets stance of the object
|
void |
resetStance()
Resets objects stance
|
void |
stopAnim()
Stops all animations
|
void |
update(int delta)
Updates object
|
draw, draw, draw, draw, draw, getDis, getPosition, getScale, getScaledHeight, getScaledWidth, isMouseOver, setPosition
bind, clampTexture, copy, destroy, draw, draw, draw, draw, draw, draw, draw, draw, draw, drawCentered, drawEmbedded, drawEmbedded, drawEmbedded, drawFlash, drawFlash, drawFlash, drawSheared, drawSheared, drawWarped, endUse, ensureInverted, flushPixelData, getAlpha, getCenterOfRotationX, getCenterOfRotationY, getColor, getFilter, getFlippedCopy, getGraphics, getHeight, getName, getResourceReference, getRotation, getScaledCopy, getScaledCopy, getSubImage, getTexture, getTextureHeight, getTextureOffsetX, getTextureOffsetY, getTextureWidth, getWidth, isDestroyed, rotate, setAlpha, setCenterOfRotation, setColor, setColor, setFilter, setImageColor, setImageColor, setName, setRotation, setTexture, startUse, toString
public AnimObject(java.io.InputStream is, java.lang.String ref, boolean flipped, int fWidth, int fHeight) throws org.newdawn.slick.SlickException
is
- InputStrem to sprite sheetref
- Name for image in systemflipped
- True if image should be flippedorg.newdawn.slick.SlickException
public void draw(float x, float y)
draw
in interface org.newdawn.slick.Renderable
draw
in class org.newdawn.slick.Image
scale
- Defines size of object(remember that object is always implicitly scaled to current resolution)public void move(boolean move)
move
- True if object should animate move, false otherwisepublic void meleeAnim(boolean loop)
public void rangeAnim(boolean loop)
public void castAnim(boolean loop)
public void stopAnim()
public void kneel(boolean kneelReq)
public void lie(boolean lieReq)
lieReq
- True to turn lie position, false otherwisepublic void resetStance()
public void reset()
public void update(int delta)
delta
- public void goUp()
public void goRight()
public void goDown()
public void goLeft()
public Sprite getCurrentSprite()
public int getDirection()
public boolean isAnimStopped()