game
Class Controller

java.lang.Object
  extended by game.Controller
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class Controller
extends java.lang.Object
implements java.awt.event.ActionListener

This class uses YOPS mostly as a canvas for placing objects and drawing pixels. All mouse listening occurs in this class, and a single method fires based on the timer to handle all time-driven events. The design of this class is modal: shooting, loading, etc.


Field Summary
static Point eyeBallLoc
           
static int quantum
           
static int slowDown
           
 
Constructor Summary
Controller(GraphicsPanel p)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent arg0)
          This method is called each time the event timer fires.
 void addAnimated(Animated a)
           
 void addGraphic(Graphic s)
           
static void main(java.lang.String[] args)
           
 void mouseMoved(GraphicsPanel p, int x, int y)
           
 void mousePressed(GraphicsPanel p, int x, int y)
           
 void mouseReleased(GraphicsPanel p, int x, int y)
           
 void removeGraphic(Graphic s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

slowDown

public static final int slowDown
See Also:
Constant Field Values

quantum

public static final int quantum
See Also:
Constant Field Values

eyeBallLoc

public static final Point eyeBallLoc
Constructor Detail

Controller

public Controller(GraphicsPanel p)
Method Detail

addAnimated

public void addAnimated(Animated a)

addGraphic

public void addGraphic(Graphic s)

removeGraphic

public void removeGraphic(Graphic s)

mouseMoved

public void mouseMoved(GraphicsPanel p,
                       int x,
                       int y)

mousePressed

public void mousePressed(GraphicsPanel p,
                         int x,
                         int y)

mouseReleased

public void mouseReleased(GraphicsPanel p,
                          int x,
                          int y)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent arg0)
This method is called each time the event timer fires. Its behavior is modal in terms of loading or shooting. However, every time this method executes, the living objects are examined, and each is given a chance to tick.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

main

public static void main(java.lang.String[] args)