-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
51 lines (37 loc) · 1.35 KB
/
Main.java
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
import java.util.Scanner;
public class Main {
private static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
boolean gaming = true;
// main game loop
while (gaming) {
update();
render();
}
}
//////// START FUNCTIONS THAT HAVE TO DO WITH UPDATE() ////////
public static void update() {
String userInput = scan.nextLine();
if (userInput.equals("w")) temp();
else if (userInput.equals("s")) temp();
else if (userInput.equals("a")) temp();
else if (userInput.equals("d")) temp();
else if (userInput.equals("inspect")) inspect();
else if (usable(userInput)) Item.tryUseItem(userInput.substring(4));
else System.out.println("thats not an option"); // TODO convert to printqueue
}
public static void inspect() {
// TODO just test code rn
Inventory.obtain("fragile glass bottle");
}
/** @return if a string is a properly formatted command starting with use **/
private static boolean usable(String query) {
return (query.substring(0,3).equals("use")) && (query.length() > 4);
}
public static void temp() {
// pass
}
//////// START FUNCTIONS THAT HAVE TO DO WITH RENDER() ////////
public static void render() {
}
}