|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrogue.Display
public class Display
The game creates a single instance of the Display class which creates
the java.awt.Frame used to display the dungeion, creates the
MyCanvas object that is the visual content of the frame,
loads the image data, and arranges to listen to keyboard inputs from
the display.
When playing, click on the display to set keyboard focus, set the
keypad in numeric lock, and enter motion commands via numeric keys.
| Constructor Summary | |
|---|---|
Display(java.lang.String name,
Map m)
Constructor - performs tasks involved in setting up the display and arranging to monitor keyboard input. |
|
| Method Summary | |
|---|---|
static char |
getLastChar()
Static access function used to get last character (accessed via class, a reference to the singleton display object not passed to Player). |
void |
keyPressed(java.awt.event.KeyEvent e)
No-op function defined to satisfy KeyListener interface. |
void |
keyReleased(java.awt.event.KeyEvent e)
No-op function defined to satisfy KeyListener interface. |
void |
keyTyped(java.awt.event.KeyEvent e)
Read and store input character (stored in a static data member). |
void |
redraw()
Requests that MyCanvas in display be redrawn. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Display(java.lang.String name,
Map m)
name - Name of dungeonm - Map structure - arrays containing the layout of dungeon and an overlay
grid used to represent location of dungeon items.| Method Detail |
|---|
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenere - Keyboard eventpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenere - Keyboard eventpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenere - Keyboard event (encoding input character - should be a numeric key
defining direction of motion).public static char getLastChar()
Playerpublic void redraw()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||