-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGAP.java
More file actions
105 lines (89 loc) · 4.7 KB
/
GAP.java
File metadata and controls
105 lines (89 loc) · 4.7 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class GAP extends Character{
Scanner in = new Scanner(System.in);
Quest quest = new Quest(this);
User user;
public void menu(){
System.out.println("\nMain Menu:");
System.out.println("\t(1) Profile \n\t(2) Play\n\t(3)Log out");
System.out.print("Enter -> ");
int mm = in.nextInt();
switch (mm){
case 1:
checkStats();
menu();
break;
case 2:
Quest questLogin = new Quest(this); // Pass the player instance to the Quest constructor
questLogin.chooseQuest();
break;
case 3:
System.out.println("Thank you for playing!");
user.updateUserDataInFile();
if (user.isLoggedIn()) {
user.updateStats();
user.updateUserDataInFile();
user.setLoggedIn(false);
break;
} else{
user.saveAccount();
break;
}
default:
System.out.println("Invalid choice");
menu();
break;
}
}
public void logo() {
System.out.println(
" ░▒▓██████▓▒░ ░▒▓██████▓▒░░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓██████▓▒░░▒▓██████████████▓▒░░▒▓████████▓▒░ \n" +
" ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ \n" +
" ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ \n" +
" ░▒▓█▓▒▒▓███▓▒░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓█▓▒▒▓███▓▒░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓██████▓▒░ \n" +
" ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ \n" +
" ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ \n" +
" ░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓████████▓▒░ \n" +
" -- Gillian --- Andrew --- Patricia -- F I N A L - P R O J E C T \n"
);
}
// ...
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Character player = new Character();
User user = new User(player);
GAP main = new GAP();
main.user = user;
main.logo();
System.out.println("Welcome to GAP game!");
int num;
boolean validChoice = false;
do {
System.out.println("1. Sign up \n2. Login \n3. Quit");
System.out.print("\nEnter -> ");
num = in.nextInt();
switch (num) {
case 1:
user.signUp();
player.setUp();
main.menu();
validChoice = true;
break;
case 2:
user.login();
main.menu();
validChoice = true;
break;
case 3:
validChoice = true;
break;
default:
System.out.println("Invalid input. Please choose a number from 1-3");
}
} while (!validChoice);
in.close();
}
// ...
}