-
Notifications
You must be signed in to change notification settings - Fork 0
/
Stage.cpp
executable file
·170 lines (148 loc) · 4.14 KB
/
Stage.cpp
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#include "Stage.h"
Stage::Stage(){
}
Stage::Stage(int level)
{
//단계로 구성
switch (level) {
case 0:
st_speed = 40;
break;
case 1:
st_speed = 30;
break;
case 2:
st_speed = 20;
break;
case 3:
st_speed = 10;
break;
/*
case 4:
st_speed = 25;
break;
case 5:
st_speed = 20;
break;
case 6:
st_speed = 15;
break;
case 7:
st_speed = 10;
break;
case 8:
st_speed = 6;
break;
case 9:
st_speed = 4;
break;
*/
}
st_clearlines = 1;
}
Stage::~Stage(){
}
int Stage::getStlevel() { return st_level; }
int Stage::getStspeed() { return st_speed; }
int Stage::getStclearlines() { return st_clearlines; }
void Stage::setStlevel(int level) { st_level = level; }
void Stage::setStspeed(int speed) { st_speed = speed; }
void Stage::setStclearlines(int clearlines) { st_clearlines = clearlines; }
void Stage::showStage(int level) {
if (level == 0) {
system("mode con:cols=100 lines=38");
sndPlaySoundA("C:\\Users\\samsung\\Documents\\Visual Studio 2015\\Projects\\tetrix\\Stage1.wav", SND_ASYNC | SND_LOOP);//노래
char keyInput[10] = "";
GdiplusStartupInput gdiplusStartupInput;//
ULONG_PTR gdiplusToken = NULL;//
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);//
Graphics *pGraphics = new Graphics(GetDC(GetConsoleWindow()));
Image *pImage = pGraphics ? new Image(L"C:\\Users\\samsung\\Documents\\Visual Studio 2015\\Projects\\tetrix\\stage1.bmp") : NULL;
if (pImage)
{
pGraphics->DrawImage(pImage, 95, 40);//0,0좌표에 그림그리기
}
else
{
printf("Error\n");
}
delete pImage;
delete pGraphics;
GdiplusShutdown(gdiplusToken);
Sleep(2000);
_getch();
system("cls");
}
else if (level == 1) {
system("mode con:cols=100 lines=38");
sndPlaySoundA("C:\\Users\\samsung\\Documents\\Visual Studio 2015\\Projects\\tetrix\\Stage2.wav", SND_ASYNC | SND_LOOP);//노래
char keyInput[10] = "";
GdiplusStartupInput gdiplusStartupInput;//
ULONG_PTR gdiplusToken = NULL;//
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);//
Graphics *pGraphics = new Graphics(GetDC(GetConsoleWindow()));
Image *pImage = pGraphics ? new Image(L"C:\\Users\\samsung\\Documents\\Visual Studio 2015\\Projects\\tetrix\\stage2.bmp") : NULL;
if (pImage)
{
pGraphics->DrawImage(pImage, 95, 40);//0,0좌표에 그림그리기
}
else
{
printf("Error\n");
}
delete pImage;
delete pGraphics;
GdiplusShutdown(gdiplusToken);
Sleep(2000);
_getch();
system("cls");
}
else if (level == 2) {
system("mode con:cols=100 lines=38");
sndPlaySoundA("C:\\Users\\samsung\\Documents\\Visual Studio 2015\\Projects\\tetrix\\Stage3.wav", SND_ASYNC | SND_LOOP);//노래
char keyInput[10] = "";
GdiplusStartupInput gdiplusStartupInput;//
ULONG_PTR gdiplusToken = NULL;//
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);//
Graphics *pGraphics = new Graphics(GetDC(GetConsoleWindow()));
Image *pImage = pGraphics ? new Image(L"C:\\Users\\samsung\\Documents\\Visual Studio 2015\\Projects\\tetrix\\stage3.bmp") : NULL;
if (pImage)
{
pGraphics->DrawImage(pImage, 95, 40);//0,0좌표에 그림그리기
}
else
{
printf("Error\n");
}
delete pImage;
delete pGraphics;
GdiplusShutdown(gdiplusToken);
Sleep(2000);
_getch();
system("cls");
}
else if (level == 3) {
system("mode con:cols=100 lines=38");
sndPlaySoundA("C:\\Users\\samsung\\Documents\\Visual Studio 2015\\Projects\\tetrix\\Boss.wav", SND_ASYNC | SND_LOOP);//노래
char keyInput[10] = "";
GdiplusStartupInput gdiplusStartupInput;//
ULONG_PTR gdiplusToken = NULL;//
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);//
Graphics *pGraphics = new Graphics(GetDC(GetConsoleWindow()));
Image *pImage = pGraphics ? new Image(L"C:\\Users\\samsung\\Documents\\Visual Studio 2015\\Projects\\tetrix\\stage4.bmp") : NULL;
if (pImage)
{
pGraphics->DrawImage(pImage, 95, 40);//0,0좌표에 그림그리기
}
else
{
printf("Error\n");
}
delete pImage;
delete pGraphics;
GdiplusShutdown(gdiplusToken);
Sleep(3000);
_getch();
system("cls");
}
}