add main menu
This commit is contained in:
@@ -1,15 +1,49 @@
|
|||||||
package org.project;
|
package org.project;
|
||||||
|
|
||||||
import org.project.location.Location;
|
import org.project.constants.appConstants.GameModes;
|
||||||
|
import org.project.constants.appConstants.TextColor;
|
||||||
|
import org.project.engine.MainEngine;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Scanner;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
static void main(String[] args) {
|
||||||
// TODO: ADD LOCATIONS TO YOUR GAME
|
Scanner scanner = new Scanner(System.in);
|
||||||
List<Location> locations = new ArrayList<>();
|
boolean endGame = false;
|
||||||
|
|
||||||
// TODO: IMPLEMENT GAMEPLAY
|
while (true) {
|
||||||
|
|
||||||
|
System.out.println(TextColor.Cyan + "JAVA KNIGHT" + TextColor.Reset);
|
||||||
|
System.out.println(
|
||||||
|
"""
|
||||||
|
0 > Single Player
|
||||||
|
1 > Local Multiplayer
|
||||||
|
2 > Exit
|
||||||
|
"""
|
||||||
|
);
|
||||||
|
|
||||||
|
GameModes gameMode = null;
|
||||||
|
while (true){
|
||||||
|
int choice = scanner.nextInt();
|
||||||
|
|
||||||
|
if (choice == 0) {
|
||||||
|
gameMode = GameModes.SINGLE_PLAYER;
|
||||||
|
break;
|
||||||
|
} else if (choice == 1) {
|
||||||
|
gameMode = GameModes.MULTI_PLAYER_LOCAL;
|
||||||
|
break;
|
||||||
|
} else if (choice == 2) {
|
||||||
|
endGame = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (endGame) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
MainEngine engine = MainEngine.CreateEngine(gameMode);
|
||||||
|
engine.run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user