I recently (<- keyword) got into programming Java, and I'm loving it! But I've ran into a little obstacle while trying to independently program... My idea was to make a fun little Character Creator - RPG Style, but I don't know how to get the user to select a class without using a bunch of If Statements.
I want to use enum's, even though I'm not really familiar with them.
So far I've got to the point of asking the user what class it wants to play + I've created the enum.
String Name;
System.out.println("Welcome to my Character Creator 2.0!\n");
Thread.sleep(2000);
System.out.print("First off, what do you want your characters name to be?\n\nName : ");
Name = Scan.nextLine();
Thread.sleep(1000);
System.out.print("\nYou are now to be known as "+ Name + "!");
System.out.print("\n\n" + Name + ", what class do you want to be? ");
Thread.sleep(1000);
System.out.print("Classes available : Knight\nMage\nDruid\nNinja\nArcher\nAdventurer");
}
So yeah, I basically want to be able to call out the the classes right from the enum, but I'm unsure how to do it. I tried something stupid like : Class = Scan.nextInt();... but it obviously didn't work