|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttipgame.game.gammacentauri.tracker.EnemyBulletTracker
public class EnemyBulletTracker
Tracks and moves an enemy's bullet.
| Field Summary | |
|---|---|
private int |
height
|
private boolean |
homing
Whether or not the bullet is homing. |
private java.awt.geom.Point2D.Double |
location
The location of the bullet. |
(package private) int |
player
|
private double |
velocityX
The horizontal velocity of the bullet. |
private double |
velocityY
The vertical velocity of the bullet. |
private int |
width
|
| Constructor Summary | |
|---|---|
EnemyBulletTracker(double x,
double y,
double velocityX,
double velocityY,
int width,
int height,
boolean homing,
int player)
Constructs a bullet 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 |
setHoming(boolean homing)
Sets whether or not the bullet is homing. |
void |
setLocation(java.awt.geom.Point2D.Double point)
Sets the location of the bullet to a given point. |
void |
setTargetPlayer(int player)
|
void |
setVelocityX(double velocityX)
Sets the horizontal velocity of the bullet to the given velocity. |
void |
setVelocityY(double velocityY)
Sets the vertical velocity of the bullet 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 boolean homing
private java.awt.geom.Point2D.Double location
private double velocityX
private double velocityY
private int width
private int height
int player
| Constructor Detail |
|---|
public EnemyBulletTracker(double x,
double y,
double velocityX,
double velocityY,
int width,
int height,
boolean homing,
int player)
x - The x-coordinate of the bullet.y - The y-coordinate of the bullet.velocityX - The horizontal velocity of the bullet.velocityY - The vertical velocity of the bullet.homing - Whether or not the bullet is homing.| 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 bullet will be moved.public void setHoming(boolean homing)
homing - Whether or not the bullet is homing.public void setTargetPlayer(int player)
public void setVelocityX(double velocityX)
velocityX - The horizontal velocity of the bullet.public double getVelocityX()
public void setVelocityY(double velocityY)
velocityY - The vertical velocity of the bullet.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 | |||||||||