-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadingScreen.java
More file actions
77 lines (62 loc) · 2.76 KB
/
LoadingScreen.java
File metadata and controls
77 lines (62 loc) · 2.76 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
package MainRepository;
public class LoadingScreen extends Screen {
// System.out.printf("▓▓▓▓▓▓▓▓▓▓▓▓▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▒▒▒▒▒▒▒▒▒▒▒▓\n");
// System.out.printf("▓▓▓▓▓▓▓▓▓▓▓▓▓\n");
private static void printCardFrame(int frame) {
System.out.printf("\n\n");
System.out.println(" SUFFLILNG CARDS\n");
System.out.printf(" "); // 앞 공백 중앙 정렬
for (int i = 0; i < frame; i++) {
System.out.printf("'-----------' "); // 카드 윗 부분 출력
}
System.out.println(); // 줄 바꿈
for(int j = 0; j <9; j++){
System.out.printf(" "); // 앞 공백 중앙 정렬
for (int i = 0; i < frame; i++) {
System.out.printf("|▒▒▒▒▒▒▒▒▒▒▒| ");
}
System.out.println(); // 줄 바꿈
}
System.out.printf(" "); // 앞 공백 중앙 정렬
for (int i = 0; i < frame; i++) {
System.out.printf("'-----------' "); // 카드 아래 부분 출력
}
System.out.println(); // 줄 바꿈
System.out.printf("\n\n");
System.out.println(" START WITH PLAYER 1. GET READY!\n");
}
public static void printScreen() {
int frame = 0;
boolean turnpoint = false;
long startTime = System.currentTimeMillis(); // 시작 시간 기록
long duration = 5000; // 5초
try {
while (System.currentTimeMillis() - startTime < duration) {
// ANSI 이스케이프 시퀀스를 사용하여 콘솔을 지우기
clearConsole();
// 로딩 프레임 출력
printCardFrame(frame);
// 다음 프레임으로 이동
if (frame == 0) turnpoint = false;
else if (frame == 5) turnpoint = true;
if (turnpoint == false) frame++;
else frame--;
// 잠시 멈춤
Thread.sleep(250); // 100ms 대기
}
// 로딩 시간이 지나면 콘솔을 지움
clearConsole();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}