|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttipgame.game.gammacentauri.tracker.ShipTracker
public class ShipTracker
Tracks and moves a player's ship.
| Field Summary | |
|---|---|
static double |
ACCEL_DAMPENER
The amount by which the velocity of the ship will be divided each time frame. |
private int |
height
|
private java.awt.geom.Point2D.Double |
location
The location of the ship. |
private double |
velocity
The velocity of the ship. |
private int |
width
|
| Constructor Summary | |
|---|---|
ShipTracker(double x,
double y,
double velocity,
int width,
int height)
Constructs a ship given an x-coordinate, y-coordinate, and velocity. |
|
| Method Summary | |
|---|---|
void |
advanceTime(double time)
called every time time is advanced. |
java.awt.geom.Point2D.Double |
getLocation()
determines the absolute location (i.e. |
double |
getRotationAddition()
determines the relative rotation. |
double |
getScaleFactor()
determines the relative scaling factor. |
double |
getVelocity()
|
void |
setLocation(double x,
double y)
|
void |
setVelocity(double velocity)
Sets the velocity of the ship to a given velocity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.awt.geom.Point2D.Double location
private double velocity
public static final double ACCEL_DAMPENER
private int width
private int height
| Constructor Detail |
|---|
public ShipTracker(double x,
double y,
double velocity,
int width,
int height)
x - The x-coordinate of the ship.y - The y-coordinate of the ship.velocity - The velocity of the ship.| Method Detail |
|---|
public java.awt.geom.Point2D.Double getLocation()
Tracker
getLocation in interface Trackerpublic double getScaleFactor()
Tracker
getScaleFactor in interface Trackerpublic double getRotationAddition()
Tracker
getRotationAddition in interface Trackerpublic void setVelocity(double velocity)
velocity - The velocity to which the ship will be set.public double getVelocity()
public void advanceTime(double time)
Tracker
advanceTime in interface Trackertime - the time in seconds since
the last frame
public void setLocation(double x,
double y)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||