I am trying to create a text-based game, and I'm struggling to Initialize the game by populating the arrays in the game class. I keep getting this error:
Game4.java:50: error: cannot find symbol
initGame();
^
symbol: method initGame()
location: class Game
1 error
My code is below. If anyone can help with possible ways to initialize without getting that error it would be greatly appreciated.
class Game {
// Declare and initialize global variables
private static final int num_locations = 5;
private static final int num_characters = 5;
private static final int num_items = 12;
private Location[] locations;
private Character[] characters;
private Item[] items;
private int currentLocation;
// Default constructor
public Game() {
// Create the array of locations
locations = new Location[num_locations];//NUM_LOCATIONS];
// Create the array of characters
characters = new Character[num_characters];//NUM_CHARACTERS];
// Create the array of items
items = new Item[num_items];//NUM_ITEMS];
// Initialize the game by populating the arrays
// with objects
initGame(); // find a new way to initialize the game by populating the game
// Set the current location to the starting location
currentLocation = 0;
}