-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtimeHeart.c
More file actions
104 lines (93 loc) · 1.67 KB
/
timeHeart.c
File metadata and controls
104 lines (93 loc) · 1.67 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
#include "header.h"
int level=0;
// 레벨 1 : 하 / 레벨 2 : 중 / 레벨 3 : 상
void gotoxy(int x, int y)
{
COORD Pos = { x,y };
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Pos);
} // 콘솔창 이동 // 콘솔창 이동
void Time(int Time)
{
int count;
if (Time < 10)
{
gotoxy(101, 0);
printf("%d", Time);
}
else
{
gotoxy(100, 0);
printf("%d", Time);
}
Sleep(1000);
for (count = Time - 1; count > 0; count--)
{
int i;
gotoxy(100, 0);
printf(" ");
gotoxy(101, 0);
printf(" ");
if (count < 10)
{
gotoxy(101, 0);
printf("%d", count);
Sleep(1000);
}
else
{
gotoxy(101, 0);
printf("%d", count);
Sleep(1000);
}
}
if (level == 1 || level == 2)
{
if (count == 0)
{
level++;
system("cls");
Sleep(5000);
typingGame(level);
}
}
else
mainMenu();
} // 시간 타이머 // 시간 타이머
void color(char text[], int i) // *************색 추가*******************
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), i);
printf(text);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
}
void drawHeart(int* i, int level) { //typinggame()에서 부딪힐 때마다 i 중가, level에 따른 하트 개수 추가
if (*i == 0) {
gotoxy(10, 4);
color("♥ ♥ ♥ ♥ ♥", 4);
}
else if (*i == 1)
{
gotoxy(10, 4);
color("♥ ♥ ♥ ♥ ♡", 4);
}
else if (*i == 2)
{
gotoxy(10, 4);
color("♥ ♥ ♥ ♡ ♡", 4);
}
else if (*i == 3)
{
gotoxy(10, 4);
color("♥ ♥ ♡ ♡ ♡", 4);
}
else if (*i == 4)
{
gotoxy(10, 4);
color("♥ ♡ ♡ ♡ ♡", 4);
}
else
{ //game over 됨.
gotoxy(10, 4);
color("♡ ♡ ♡ ♡ ♡", 4);
gameOverMenu();
}
} // 생명력 // heart("문자열") -> 문자열이랑 다를 시 하트 깍임