game
Class Controller
java.lang.Object
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
Controller
public Controller(GraphicsPanel p)
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)