Class Game

All Implemented Interfaces:
KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class Game extends JFrame implements KeyListener
A GUI game that involves a professor chasing treasure and goblins chasing the professor.
See Also:
  • Field Details

  • Constructor Details

    • Game

      public Game()
  • Method Details

    • main

      public static void main(String[] args)
    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class Window
    • clearBuffer

      public void clearBuffer()
    • nextFrame

      public void nextFrame(int delay)
      Parameters:
      delay - in ms
    • keyPressed

      public void keyPressed(KeyEvent e)
      Pressing certain keys controls direction of professor
      Specified by:
      keyPressed in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      ignore released keys
      Specified by:
      keyReleased in interface KeyListener
    • keyTyped

      public void keyTyped(KeyEvent e)
      ignore typed keys
      Specified by:
      keyTyped in interface KeyListener
    • play

      public void play()
      plays the game
    • getHuman

      public Human getHuman()
      Returns a copy of the human (the professor) in the Game
      Returns:
      a copy of the human (the professor) in the Game