HOME | PROJECTS | REALITY | EMAIL

Class GfxCopsNRobbers

java.lang.Object
  |
  +--ReBaseReality
        |
        +--GfxCopsNRobbers

public class GfxCopsNRobbers
extends ReBaseReality

Name: CopsNRobbers Desc: a simple chase game with 2 players and collision detection arrows - move cop
'a', 's', 'd', 'w' move robber left down right up
a message is printed to the console when collisions occur.

Author:
Ge Wang (www.gewang.com), Harteg Wariyar (hsw2@duke.edu), Ted Hung (tsh5@duke.edu)

Constructor Summary
GfxCopsNRobbers()
           
 
Method Summary
 void init(Gfx gfx)
          initialization for simulation
 void keyPressed(java.awt.event.KeyEvent e)
          key handler
 void keyReleased(java.awt.event.KeyEvent e)
          key up handler
static void main(java.lang.String[] args)
           
 void run()
          simluation body
 
Methods inherited from class ReBaseReality
keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GfxCopsNRobbers

public GfxCopsNRobbers()
Method Detail

init

public void init(Gfx gfx)
initialization for simulation
Parameters:
gfx - interface reference
Overrides:
init in class ReBaseReality

run

public void run()
simluation body
Overrides:
run in class ReBaseReality

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
key handler
Overrides:
keyPressed in class ReBaseReality

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
key up handler
Overrides:
keyReleased in class ReBaseReality

main

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


HOME | PROJECTS | REALITY | EMAIL