spacewar
Class Ship
java.lang.Object
|
+--spacewar.SpaceObject
|
+--spacewar.Ship
- class Ship
- extends SpaceObject
Methods inherited from class spacewar.SpaceObject |
, accelerate, die, getGame, getOldXPos, getOldYPos, getXPos, getXVel, getYPos, getYVel, isAlive, setIsAlive, setXVel, setYVel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
helmCommandsCut(Ship)
MAX_DAMAGE
static final int MAX_DAMAGE
BULLET_SPEED
static final int BULLET_SPEED
CLOCKWISE
static final int CLOCKWISE
STOP
static final int STOP
COUNTERCLOCKWISE
static final int COUNTERCLOCKWISE
DEFAULT_ANGULAR_VELOCITY
static final double DEFAULT_ANGULAR_VELOCITY
DEFAULT_ACCELERATION
static final double DEFAULT_ACCELERATION
Ship
Ship(Game theGame,
double xPos,
double yPos,
double orientation)
Advised by: spacewar.Display1.ShipDA, spacewar.Display2.ShipDA
getSize
int getSize()
- Overrides:
getSize
in class SpaceObject
getEnergy
double getEnergy()
getDamage
double getDamage()
getOrientation
double getOrientation()
getRAcc
double getRAcc()
getPilot
Pilot getPilot()
setPilot
void setPilot(Pilot p)
getEnergyLevel
float getEnergyLevel()
getDamageLevel
float getDamageLevel()
expendEnergy
boolean expendEnergy(double amount)
inflictDamage
void inflictDamage(double amount)
repairDamage
void repairDamage(double amount)
clockTick
public void clockTick()
- Overrides:
clockTick
in class SpaceObject
setAcceleration
void setAcceleration(double acc)
-
First check to make sure we have enough energy to accelerate. If
we do, then go ahead and do so. Acceleration is in the direction
we are already facing (i.e. orientation).
setAngularVelocity
void setAngularVelocity(double omega)
rotate
void rotate(int direction)
Advised by: spacewar.EnsureShipIsAlive
thrust
void thrust(boolean onOff)
Advised by: spacewar.EnsureShipIsAlive
fire
void fire()
Advised by: spacewar.EnsureShipIsAlive
stop
void stop()
Advised by: spacewar.EnsureShipIsAlive
handleCollision
void handleCollision(SpaceObject obj)
- Overrides:
handleCollision
in class SpaceObject
bounce
static void bounce(Ship shipA,
Ship shipB)