|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttipgame.game.gammacentauri.tracker.EnemyTracker
public class EnemyTracker
Tracks and moves an enemy.
| Field Summary | |
|---|---|
private int |
height
|
private java.awt.geom.Point2D.Double |
location
The location of the enemy. |
private double |
velocityX
The horizontal velocity of the enemy. |
private double |
velocityY
The vertical velocity of the enemy. |
private int |
width
|
| Constructor Summary | |
|---|---|
EnemyTracker(double x,
double y,
double velocityX,
double velocityY,
int width,
int height)
Constructs an enemy given an x-coordinate, y-coordinate, horizontal velocity, and vertical 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 |
getVelocityX()
|
double |
getVelocityY()
|
void |
setLocation(java.awt.geom.Point2D.Double point)
Sets the location of the enemy to a given point. |
void |
setVelocityX(double velocityX)
Sets the horizontal velocity of the enemy to the given velocity. |
void |
setVelocityY(double velocityY)
Sets the vertical velocity of the enemy to the 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 velocityX
private double velocityY
private int width
private int height
| Constructor Detail |
|---|
public EnemyTracker(double x,
double y,
double velocityX,
double velocityY,
int width,
int height)
x - The x-coordinate of the enemy.y - The y-coordinate of the enemy.velocityX - The horizontal velocity of the enemy.velocityY - The vertical velocity of the enemy.| Method Detail |
|---|
public java.awt.geom.Point2D.Double getLocation()
Tracker
getLocation in interface Trackerpublic void setLocation(java.awt.geom.Point2D.Double point)
point - The point to which the enemy will be moved.public void setVelocityX(double velocityX)
velocityX - The horizontal velocity of the enemy.public double getVelocityX()
public void setVelocityY(double velocityY)
velocityY - The vertical velocity of the enemy.public double getVelocityY()
public double getScaleFactor()
Tracker
getScaleFactor in interface Trackerpublic double getRotationAddition()
Tracker
getRotationAddition in interface Trackerpublic void advanceTime(double time)
Tracker
advanceTime in interface Trackertime - the time in seconds since
the last frame
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||