-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.java
More file actions
70 lines (60 loc) · 2.13 KB
/
Game.java
File metadata and controls
70 lines (60 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import java.util.Random;
import java.util.Scanner;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Game {
Scanner sc = new Scanner(System.in);
Random rand = new Random();
Methods method = new Methods();
public void prompt() {
System.out.println("What is your name?");
System.out.print(">> ");
String pName = sc.nextLine();
System.out.println("Welcome to JarPRee " + pName + ". Let's begin the battle right away!");
System.out.println("\n------------------------------------------------------------------\n");
System.out.println("Select an action by typing a number and hit enter.");
try {
TimeUnit.SECONDS.sleep(0);
} catch (InterruptedException ex) {
Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);
}
} // prompt
public void mAppearPrompt() {
// this gonna be hard af, so let's do turn mechanic first
}
public void selection() {
System.out.println("What would you like to do?");
System.out.println("1. Attack");
System.out.println("2. Spell");
System.out.println("3. Status");
System.out.println("4. Inventory");
System.out.print(">> ");
try {
int pSelect = sc.nextInt();
switch (pSelect) {
case 1:
method.pAttack();
break;
case 2:
method.pSpellSelection();
break;
case 3:
method.Status();
break;
case 4:
method.inventory();
break;
case 1022:
method.uwu();
break;
default:
System.out.println("Not a valid option.");
break;
} // switch
} catch (java.util.InputMismatchException ex) {
sc.nextLine();
System.out.println("Try again.");
} // catch
} // selection
} // Game