Package game
Class Scene
java.lang.Object
game.Scene
A scene in the game
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckForItem(Item item) booleancheckForNeed(Item item) intenterScene(Player player) voidsetAnnouncement(String announcement) set x and y coordinates of scenevoidsetCoordinates(int x, int y) set x and y coordinates of scenevoidvoidstatic voidSetting the scenes.toString()
-
Field Details
-
x
public int xc and y coordinates of scene -
y
public int yc and y coordinates of scene -
ROWS
public static final int ROWS- See Also:
-
COLS
public static final int COLS- See Also:
-
map
-
-
Constructor Details
-
Scene
title and action of scene -
Scene
-
-
Method Details
-
setAnnouncement
set x and y coordinates of scene -
setCoordinates
public void setCoordinates(int x, int y) set x and y coordinates of scene -
enterScene
-
setItem
-
checkForItem
-
setNeed
-
checkForNeed
-
toString
-
setScenes
public static void setScenes()Setting the scenes. Each scene has a title and a announcement. Only one item may be required to be in the player's possession If you want the player to have more than one, use an arraylist. The item at the scene may be something to pickup, goes with PICKUP_ACTION, or it may be the npc name with a FIGHT_ACTION This is the longest method in the Game program. One way to shorten it is to put all the data into text file and use that to populate the items and scenes. You would need to put the items into an array, and track what indexes belong to which scene
-