|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrogue.Images
public class Images
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 |
|---|
public static java.awt.Image[] theImages
public static final int kBLANK
public static final int kWALL
public static final int kGOLD
public static final int kHEAL
public static final int kPLAYER
public static final java.lang.String[] thefiles
| Constructor Detail |
|---|
public Images()
| Method Detail |
|---|
public static void loadImages(java.awt.Frame f)
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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||