|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttipgame.game.gammacentauri.tracker.BulletTracker
public class BulletTracker
Tracks and moves a player's bullet.
| Field Summary | |
|---|---|
private int |
height
|
private java.awt.geom.Point2D.Double |
location
The location of the bullet. |
private double |
offset
|
private boolean |
spread
|
private double |
velocity
The velocity of the bullet. |
private double |
velocityX
|
private int |
width
|
| Constructor Summary | |
|---|---|
BulletTracker(double x,
double y,
double velocity,
int width,
int height)
Constructs a bullet 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. |
boolean |
getSpread()
|
void |
setLocation(java.awt.geom.Point2D.Double point)
Sets the location of the bullet to a given point. |
void |
setSpread(boolean spread)
|
void |
setVelocity(double velocity)
Sets the velocity of the bullet 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
private double velocityX
private int width
private int height
private boolean spread
private double offset
| Constructor Detail |
|---|
public BulletTracker(double x,
double y,
double velocity,
int width,
int height)
x - The x-coordinate of the bullet.y - The y-coordinate of the bullet.velocity - The velocity of the bullet.| 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 setVelocity(double velocity)
velocity - The velocity to which the bullet will be set.public double getScaleFactor()
Tracker
getScaleFactor in interface Trackerpublic double getRotationAddition()
Tracker
getRotationAddition in interface Trackerpublic boolean getSpread()
public void setSpread(boolean spread)
public 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 | |||||||||