uwcse.sim
Class PacManController

java.lang.Object
  |
  +--uwcse.graphics.GWindowEventAdapter
        |
        +--uwcse.sim.PacManController
All Implemented Interfaces:
uwcse.graphics.GWindowEventHandler

class PacManController
extends uwcse.graphics.GWindowEventAdapter

This class demos the use of the GWindow Event system. It is a subclass of the dummy EventAdapter that just turns keypresses into changes of direction for the Man being controlled.


Field Summary
(package private)  Man theMan
           
 
Constructor Summary
PacManController(Man m)
          Create a new controller for the given man.
 
Method Summary
 void keyPressed(uwcse.graphics.GWindowEvent e)
          The interesting keys are j (west); k (south); i (north); and l (east).
 
Methods inherited from class uwcse.graphics.GWindowEventAdapter
keyReleased, mousePressed, mouseReleased, timerExpired
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theMan

Man theMan
Constructor Detail

PacManController

public PacManController(Man m)
Create a new controller for the given man.
Method Detail

keyPressed

public void keyPressed(uwcse.graphics.GWindowEvent e)
The interesting keys are j (west); k (south); i (north); and l (east).
Overrides:
keyPressed in class uwcse.graphics.GWindowEventAdapter