Hi. I've been working on a text-based RPG in java, just for fun. After spending many hours of tedious work writing almost a dozen classes for weapons, spells, cmbat systems, shopping systems, etc. I wrote a simple class to start and run the game. All it really does is display a main menu, and create an object which in turn creates every class in the game and starts a new game. The code for the RunGame class is below:
import java.util.Scanner;
import java.util.Random;
public class RunGame {
public static void main(String []args) {
Scanner reader = new Scanner(System.in);
int choice = 0;
QueratiaMain main = new QueratiaMain(); //code stops responding after creation of this object. why?
// reader.nextLine();
System.out.println("Welcome to Queratia, a text-based RPG! Choose an option:\n1. Start New Game\n2. Exit");
choice = reader.nextInt();
if(choice == 1) {
}else
System.exit(99);
}
}
Everything compiles fine, but when I run the program, the code seems to stop progressing at whatever line I create the QueratiaMain object in. Any ideas as to why it would do this? Thanks!
UPDATE: After debugging the code, I got to several lines where the debugger told me that the source was not found, and certain lines were throwing a file not found exception. However, I am working from a normal workspace in Eclipse, so how could this be? I tried to manually specify where to find the files, but nothing changed. Any ideas on why this could be happening?