All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.player.tracker.TrackerStrategy

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----pinball.player.Strategy
                   |
                   +----pinball.player.tracker.TrackerStrategy

public class TrackerStrategy
extends Strategy
The player tracks the ball's progress.


Variable Index

 o lastTime
Time between missed ball's till previous locations are erased.
 o lastX
Last ball's location.
 o lastY
Last ball's location.
 o locations
Previous ball location's.
 o maxLocations
Number of previous locations found.

Constructor Index

 o TrackerStrategy(Buffer, TextArea, Camera)
The strategy thread for the player.

Method Index

 o draw(Graphics, int, int)
Draw some objects for the person touch.
 o special()
Find the angle and store previous locations.

Variables

 o locations
 protected Vector locations
Previous ball location's.

 o maxLocations
 protected int maxLocations
Number of previous locations found.

 o lastX
 protected int lastX
Last ball's location.

 o lastY
 protected int lastY
Last ball's location.

 o lastTime
 protected long lastTime
Time between missed ball's till previous locations are erased.

Constructors

 o TrackerStrategy
 public TrackerStrategy(Buffer buffer,
                        TextArea gameStats,
                        Camera camera)
The strategy thread for the player.

Parameters:
buffer - the first buffer in the series of buffers for the system.
gameStats - the area to write the game stats to.
camera - the camera for the system.

Methods

 o special
 public void special()
Find the angle and store previous locations.

Overrides:
special in class Strategy
 o draw
 public void draw(Graphics g,
                  int canvasWidth,
                  int canvasHeight)
Draw some objects for the person touch. If they touch them, change the object's color.

Parameters:
g - the graphics to draw to.
cavasWidth - the width of the canvas.
canvcasHeight - the hight of the canvas.
Overrides:
draw in class Strategy

All Packages  Class Hierarchy  This Package  Previous  Next  Index