-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
87 lines (57 loc) · 1.24 KB
/
main.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
#include <string>
#include <cmath>
#include "mine_sweeper.h"
#include <time.h>
#include <stdlib.h>
#include <Windows.h>
//The window we'll be rendering to
SDL_Window* gWindow = NULL;
//The window renderer
SDL_Renderer* gRenderer = NULL;
//Globally used font
TTF_Font *gFont = NULL;
LTexture gTextTexture;
Mix_Chunk * Move_Back_Sound=NULL;
Mix_Chunk * Move_START_Sound=NULL;
Mix_Chunk * Move_Select_Sound=NULL;
Mix_Chunk * Boom_Sound=NULL;
Mix_Chunk * Clear_Sound=NULL;
int main(int argc, char* args[])
{
system("title minesweeper");
//Start up SDL and create window
if (!init())
{
printf("Failed to initialize!\n");
}
else
{
//Load media
loadMedia();
GameManager GM;
srand((int)time(NULL));
GM.load_minepic();
GM.GM_Init();
while (1)
{
switch (GM.Get_Menu_Level())
{
case FIRST_MENU: //처음 메뉴화면
GM.Main_Menu_Fuct(); //메인메뉴 관리 함수
break;
case SECOND_MENU: //START 누른후
GM.Select_Level_Fuct(); //레벨 선택 창 함수
break;
case THIRD_MENU: //이제 레벨에 맞게 게임 플레이
GM.Game_Play_Fuct();
break;
}
if (GM.Get_EndFlag() == true)
goto END;
}
}
END:
//Free resources and close SDL
close();
return 0;
}