rogue
Class Images

java.lang.Object
  extended by rogue.Images

public class Images
extends java.lang.Object

A static class that is used to map image identification numbers to images read from file.
This class will need to be updated in the assignment as additional images will need to be defined for your monster classes.
You add image file names to array thefiles[] and define index numbers that identify images for different types of monster.


Field Summary
static int kBLANK
          Identifier for "blank" - unoccupied area in dungeon.
static int kGOLD
          Index for "treasure" image.
static int kHEAL
          Index for image representing something that restores health.
static int kPLAYER
          Player icon.
static int kWALL
          Identifier for "wall" - solid area of dungeon layout.
static java.lang.String[] thefiles
          Array of strings with filenames for GIF (or JPG) images used to display monsters etc.
static java.awt.Image[] theImages
          Array of Image objects loaded from file.
 
Constructor Summary
Images()
           
 
Method Summary
static void loadImages(java.awt.Frame f)
          Static function that loads the images from their data files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theImages

public static java.awt.Image[] theImages
Array of Image objects loaded from file.


kBLANK

public static final int kBLANK
Identifier for "blank" - unoccupied area in dungeon.

See Also:
Constant Field Values

kWALL

public static final int kWALL
Identifier for "wall" - solid area of dungeon layout. (Each image has an identifier, these are recorded in grid square of Map. When Map object paints the view of game, it asks Images object for the particular image corresponding to an integer identifier.)

See Also:
Constant Field Values

kGOLD

public static final int kGOLD
Index for "treasure" image.

See Also:
Constant Field Values

kHEAL

public static final int kHEAL
Index for image representing something that restores health.

See Also:
Constant Field Values

kPLAYER

public static final int kPLAYER
Player icon.

See Also:
Constant Field Values

thefiles

public static final java.lang.String[] thefiles
Array of strings with filenames for GIF (or JPG) images used to display monsters etc. Will need to be extended.

Constructor Detail

Images

public Images()
Method Detail

loadImages

public static void loadImages(java.awt.Frame f)
Static function that loads the images from their data files. Arranges to block the application until all the images are loaded.

Parameters:
f - Reference to java.awt.Frame - this is needed to find the Toolkit (needed to access image loading functions)and as the "ImageObserver" needed when loading an image.