|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.sprites.Sprite
public abstract class Sprite
Title: Sprite
Description: Base Sprite for all game items
Copyright: Copyright (c) 2005
Field Summary | |
---|---|
protected BoundingBox |
boundingBox
|
protected CollisionMap |
collisionMap
|
protected GameLocation |
location
|
protected SpriteSize |
size
|
Constructor Summary | |
---|---|
Sprite()
Sprite |
|
Sprite(SpriteSize size)
Sprite |
Method Summary | ||
---|---|---|
abstract
|
copy()
|
|
abstract void |
draw(java.awt.Graphics2D graphics,
int xOffset,
int yOffset)
Draws the sprite with the current offset. |
|
BoundingBox |
getBounds()
|
|
int |
getDepth()
|
|
int |
getHeight()
|
|
GameLocation |
getLocation()
|
|
java.lang.String |
getName()
|
|
SpriteSize |
getSize()
|
|
int |
getWidth()
|
|
double |
getXLocation()
|
|
double |
getYLocation()
|
|
boolean |
removeFromMap()
This is a flag to tell the GameMap, to remove this sprite from the map. |
|
void |
setBoundingBox(BoundingBox boundingBox)
|
|
void |
setBoundingBox(int left,
int top,
int right,
int bottom)
|
|
void |
setCollisionMap(CollisionMap collisionMap)
setCollisionMap |
|
void |
setLocation(GameLocation location)
|
|
void |
setName(java.lang.String name)
|
|
void |
setSize(SpriteSize spriteSize)
|
|
protected abstract void |
spriteCollison(Sprite collideSprite)
Handle the collision with another sprite. |
|
java.lang.String |
toString()
|
|
abstract void |
update(long elapseTime)
This method takes the elapse time, and calculates the new current frame of the animation. |
|
void |
updateLocation(double x,
double y)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected SpriteSize size
protected GameLocation location
protected BoundingBox boundingBox
protected CollisionMap collisionMap
Constructor Detail |
---|
public Sprite()
public Sprite(SpriteSize size)
size
- SpriteSizeMethod Detail |
---|
public abstract <Sprite> Sprite copy()
Sprite
-
public abstract void draw(java.awt.Graphics2D graphics, int xOffset, int yOffset)
graphics
- xOffset
- yOffset
- public BoundingBox getBounds()
public int getDepth()
public int getHeight()
public GameLocation getLocation()
public java.lang.String getName()
getName
in interface Updateable
public SpriteSize getSize()
public int getWidth()
public double getXLocation()
public double getYLocation()
public boolean removeFromMap()
public void setBoundingBox(BoundingBox boundingBox)
public void setBoundingBox(int left, int top, int right, int bottom)
public void setCollisionMap(CollisionMap collisionMap)
collisionMap
- CollisionMappublic void setLocation(GameLocation location)
location
- GameLocationpublic void setName(java.lang.String name)
name
- public void setSize(SpriteSize spriteSize)
spriteSize
- SpriteSizepublic java.lang.String toString()
toString
in class java.lang.Object
public abstract void update(long elapseTime)
Updateable
update
in interface Updateable
elapseTime
- longpublic void updateLocation(double x, double y)
x
- y
- protected abstract void spriteCollison(Sprite collideSprite)
collideSprite
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |