|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.gatech.cs2335.lemmings.graphics.AnimatedSprite
Class AnimatedSprite: This animated sprite will be used to render all things animated onto the screen. It will be created using a TileSet, and will treat the frames as follows: it will keep track of which direction the sprite is moving in. If we are moving in a certain direction, we will only use half of the frames - which half depends on where we are moving - from left to right means using the first half of the frames, and from right to left - the second half. If the sprite is not moving in any direction, all frames will be used in the animation.
Revision History:
v1.0 (Mar. 12, 2004) - Created the AnimatedSprite class
TileSet,
TileSetManager| Constructor Summary | |
AnimatedSprite()
Creates a new AnimatedSprite instance. |
|
AnimatedSprite(TileSet anim)
Creates a new AnimatedSprite instance. |
|
AnimatedSprite(TileSet anim,
Direction dir,
Looping loop)
Creates a new AnimatedSprite instance. |
|
| Method Summary | |
TileSet |
getAnimation()
Returns the tileset associated with the sprite. |
int |
getCurrentFrame()
Returns the current frame number. |
Looping |
getLoopingMode()
Returns the looping mode. |
Direction |
getMovementDirection()
Returns the direction in which the sprite is moving. |
protected int |
getNumFrames()
Returns the number of frames in a complete loop of animation. |
boolean |
isInitialized()
Returns true if the sprite is initialized with animation already, and false f it is not yet. |
int |
nextFrameNumber()
Returns the next frame number and increments the counter. |
boolean |
renderSprite(java.awt.Graphics g,
java.awt.Point coordinates)
Renders the sprite at the specified coordinates. |
void |
setAnimation(TileSet v)
Sets the new animation for the sprite. |
void |
setLoopingMode(Looping v)
Sets a new looping mode. |
void |
setMovementDirection(Direction v)
Sets a direction in which the sprite is moving. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AnimatedSprite()
AnimatedSprite instance.
public AnimatedSprite(TileSet anim)
AnimatedSprite instance.
anim - a TileSet value
public AnimatedSprite(TileSet anim,
Direction dir,
Looping loop)
AnimatedSprite instance.
anim - a TileSet valuedir - a Direction valueloop - a Looping value| Method Detail |
public boolean isInitialized()
boolean valueprotected int getNumFrames()
int valuepublic Direction getMovementDirection()
Direction valuepublic void setMovementDirection(Direction v)
v - a Direction valuepublic Looping getLoopingMode()
Looping valuepublic void setLoopingMode(Looping v)
v - a Looping valuepublic TileSet getAnimation()
TileSet valuepublic void setAnimation(TileSet v)
v - a TileSet valuepublic int getCurrentFrame()
int value.public int nextFrameNumber()
int value.
public boolean renderSprite(java.awt.Graphics g,
java.awt.Point coordinates)
g - a Graphics valuecoordinates - a Point value
boolean value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||