-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGameMode1.h
158 lines (125 loc) · 3.31 KB
/
GameMode1.h
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
#pragma once
#include "SDL.h"
class Mode1 : public PhaseInterface
{
public:
Mode1();
~Mode1();
virtual void HandleEvents() override;
virtual void Update() override;
virtual void Render() override;
void userMove();
void holdMove();
bool checkHold();
void ResetGame();
//void stun_effect();
private:
// ��� �̹��� ũ��
const int BACKGROUND_WIDTH = 800;
const int BACKGROUND_HEIGHT = 1800;
const int WALL_WIDTH = 400;
const int WALL_HEIGHT = 5400;
//��Ʈ�� (tuto)
SDL_Texture* g_texture_intro;
SDL_Rect g_source_rectangle_intro;
SDL_Rect g_destination_rectangle_intro;
//�÷��̹�ư
SDL_Texture* g_texture_play;
SDL_Rect g_source_rectangle_play;
SDL_Rect g_destination_rectangle_play;
//ready
SDL_Surface* ready_surface;
SDL_Texture* ready_texture;
SDL_Rect ready_rect;
SDL_Rect ready_dest_rect;
// start
SDL_Surface* start_surface;
SDL_Texture* start_texture;
SDL_Rect start_rect;
SDL_Rect start_dest_rect;
// introBack button
SDL_Surface* introBack_surface;
SDL_Texture* introBack_texture;
SDL_Rect introBack_rect;
SDL_Rect introBack_dest_rect;
// bg
SDL_Surface* bg_surface;
SDL_Texture* bg_texture;
SDL_Rect bg_rect;
SDL_Rect bg_dest_rect;
int backgroundY; // ��� �̹����� Y ��ǥ
// wall
SDL_Surface* wall_surface;
SDL_Texture* wall_texture;
SDL_Rect wall_rect;
SDL_Rect wall_dest_rect;
int wallY;
// timeBg
SDL_Surface* timeBg_surface;
SDL_Texture* timeBg_texture;
SDL_Rect timeBg_rect;
SDL_Rect timeBg_dest_rect;
// time
TTF_Font* font;
SDL_Surface* time_surface;
SDL_Texture* time_texture;
SDL_Rect time_rect;
TTF_Font* font2;
SDL_Surface* time2_surface;
SDL_Texture* time2_texture;
SDL_Rect time2_rect;
int leftHoldY = 475; //���� 150 ���̿��� 75 ���� ����� 200 ���̴ϱ� 100���̳���
int rightHoldY = 375;
// leftUser
SDL_Surface* leftUser_surface;
SDL_Texture* leftUser_texture;
SDL_Rect leftUser_rect;
SDL_Rect leftUser_dest_rect;
// rightUser
SDL_Surface* rightUser_surface;
SDL_Texture* rightUser_texture;
SDL_Rect rightUser_rect;
SDL_Rect rightUser_dest_rect;
// stun ȿ��
SDL_Surface* stun_surface;
SDL_Texture* stun_texture;
SDL_Rect stun_rect;
SDL_Rect stun_dest_rect;
// ending BG
SDL_Texture* g_texture_ending;
SDL_Rect g_source_rectangle_ending;
SDL_Rect g_destination_rectangle_ending;
// ending home button
SDL_Texture* g_texture_home;
SDL_Rect g_source_rectangle_home;
SDL_Rect g_destination_rectangle_home;
// ending retry button
SDL_Texture* g_texture_retry;
SDL_Rect g_source_rectangle_retry;
SDL_Rect g_destination_rectangle_retry;
int hold[41]; // 1:down 2:left 3: right 4: up
int f_state; // 1:down 2:left 3: right 4: up
bool isLeftUser = true;
int prevHoldIndex = -1;
Uint32 startTime = 0;
Uint32 gameoverTime = 0;
Uint32 startsTime;
// ��� ����
Mix_Music* bg_mus;
// jump wav
Mix_Chunk* jump_wav;
// btn
Mix_Chunk* btn_wav;
// game clear wav
Mix_Chunk* gameClear_wav;
//readyStart
Mix_Chunk* ready_sound;
int cur_i;
int prevHold;
bool tutorial;
bool ready;
bool start;
bool game_start;
bool game_over;
bool game_ending;
};