|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--objects.DrawableGameObject | +--objects.Explosion
This is an explosion object. An explosion has a current and a maximum level. The levels are used to determine the diameter of the drawn object. The level increases to the maximum, then moves down to zero. The server provides the animation by sending new levels at fixed intervals.
If you write a user defined client, you should not try change this object by calling any of it's setter methods, as it will make your view of the game different from all the other players' views.
Also note that for clients, not all getter methods return usable results, as the server doesn't send everything across. The following information is, however, updated and usable for this class:
Field Summary |
Fields inherited from class objects.DrawableGameObject |
bounds, dir, loc |
Constructor Summary | |
Explosion(short id,
int x,
int y,
byte level,
byte maxLevel)
Constructs a new explosion, with the given initial settings. |
Method Summary | |
void |
draw(java.awt.Graphics g)
Draws the object in the given graphic context. |
byte |
getLevel()
Returns the current level of this explosion. |
byte |
getMaxLevel()
Returns the maximum level of this explosion. |
void |
setLevel(byte level)
Sets the current level of this explosion. |
void |
setMaxLevel(byte level)
Sets the maximum level of this explosion. |
Methods inherited from class objects.DrawableGameObject |
getBounds, getDirection, getDirectionAsShort, getId, getLocation, setDirection, setDirectionFromShort, setId, setLocation, setLocation, updateBounds |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Explosion(short id, int x, int y, byte level, byte maxLevel)
id
- the ID of this object.x
- x-coordinate in the world.y
- y-coordinate.level
- the current level (relative to diameter).maxLevel
- the maximum level.Method Detail |
public final void setLevel(byte level)
level
- the level.public final byte getLevel()
public final void setMaxLevel(byte level)
level
- the level.public final byte getMaxLevel()
public final void draw(java.awt.Graphics g)
DrawableGameObject
Image
with the size of the entire world,
so the drawing routine doesn't need to displace it's coordinates.
draw
in class DrawableGameObject
g
- the graphic context.DrawableGameObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |