Package game

Class Scene

java.lang.Object
game.Scene

public class Scene extends Object
A scene in the game
  • Field Details

    • x

      public int x
      c and y coordinates of scene
    • y

      public int y
      c and y coordinates of scene
    • ROWS

      public static final int ROWS
      See Also:
    • COLS

      public static final int COLS
      See Also:
    • map

      public static Scene[][] map
  • Constructor Details

    • Scene

      public Scene(String title, int action)
      title and action of scene
    • Scene

      public Scene(int row, int col, String title, String ann, int action, Item item, Item need)
  • Method Details

    • setAnnouncement

      public void setAnnouncement(String announcement)
      set x and y coordinates of scene
    • setCoordinates

      public void setCoordinates(int x, int y)
      set x and y coordinates of scene
    • enterScene

      public int enterScene(Player player)
    • setItem

      public void setItem(Item item)
    • checkForItem

      public boolean checkForItem(Item item)
    • setNeed

      public void setNeed(Item item)
    • checkForNeed

      public boolean checkForNeed(Item item)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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