tipgame
Interface Tracker

All Known Implementing Classes:
BulletTracker, CompositeTracker, EnemyBulletTracker, EnemyTracker, Explode.ShrinkSpinTracker, ProjectileTracker, ShipTracker, ShootForwardTracker, TrackerAdapter, VerticalSineWaveTracker

public interface Tracker

provides a mechanism for altering the size, location, orientation and other aspects of a Sprite between each frame

Author:
Jam Jenkins

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.
 

Method Detail

getLocation

java.awt.geom.Point2D.Double getLocation()
determines the absolute location (i.e. not necessarily relative to the Sprite's last location)

Returns:
the absolute location of the Sprite

getScaleFactor

double getScaleFactor()
determines the relative scaling factor. This method will take the current size of the Sprite and scale it by the factor returned

Returns:
the multiplicative scaling factor

getRotationAddition

double getRotationAddition()
determines the relative rotation. This method will take the current orientation and rotate it by the value returned.

Returns:
the amount to rotate in radians

advanceTime

void advanceTime(double time)
called every time time is advanced. The amount of time which has passed since the last call. This method must also accept negative time intervals for reversing time. The magnitude of the negative time interval will not exceed the magnitude of the last positive time interval. Also, the keyboard and mouse inputs will remain constant when the interval is negative.

Parameters:
time - the time in seconds since the last frame