|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--objects.DrawableGameObject | +--objects.Phaser
This is a single phaser shot.
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 | |
Phaser(short id,
Player owner,
int x,
int y,
double dir,
java.awt.Color col)
Constructs a new phaser "bullet", with the given initial settings. |
|
Phaser(short id,
Player owner,
int x,
int y,
short dir,
java.awt.Color col)
Constructs a new phaser "bullet", with the given initial settings. |
Method Summary | |
void |
draw(java.awt.Graphics g)
Draws the object in the given graphic context. |
java.awt.Color |
getColor()
Returns the main color used for drawing this object. |
Player |
getOwner()
Finds the player who fired this phaser shot. |
void |
setColor(java.awt.Color col)
Sets the main color used when drawing this object. |
void |
setOwner(Player owner)
Sets the owner of this phaser shot, that is the player who fired it. |
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 Phaser(short id, Player owner, int x, int y, double dir, java.awt.Color col)
id
- the ID of this object.owner
- the player that fired this phaser.x
- x-coordinate in the world.y
- y-coordinate.dir
- direction angle in radians.col
- bomb color.public Phaser(short id, Player owner, int x, int y, short dir, java.awt.Color col)
short
to save some bandwidth.
id
- the ID of this object.owner
- the player that fired this phaser.x
- x-coordinate in the world.y
- y-coordinate.dir
- direction encoded as a short
.col
- bomb color.Method Detail |
public final void setOwner(Player owner)
owner
- the player who owns the phaser.public final Player getOwner()
public final void setColor(java.awt.Color col)
col
- the color.public final java.awt.Color getColor()
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 |