-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameWindow.h
More file actions
104 lines (85 loc) · 2.09 KB
/
GameWindow.h
File metadata and controls
104 lines (85 loc) · 2.09 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
#ifndef MAINWINDOW_H_INCLUDED
#define MAINWINDOW_H_INCLUDED
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_audio.h>
#include <allegro5/allegro_acodec.h>
#include <allegro5/allegro_font.h>
#include "./algif5/src/algif.h"
#include <vector>
#include <list>
#include "levi.h"
#include "menu.h"
#include "story.h"
#include "story2.h"
#include "global.h"
#include "frame.h"
#include "frame2.h"
#define GAME_INIT -1
#define GAME_SETTING 0
#define GAME_SELECT 1
#define GAME_BEGIN 2
#define GAME_CONTINUE 3
#define GAME_FAIL 4
#define GAME_TERMINATE 5
#define GAME_NEXT_LEVEL 6
#define GAME_EXIT 7
#define STORY_START 8
// clock rate
const float FPS = 60;
class GameWindow
{
public:
// constructor
GameWindow();
// each process of scene
void game_init();
void game_reset();
void game_play();
void game_begin();
void game1_draw();
void game2_draw();
void process_event();
int game_run();
int game_update();
void show_err_msg(int msg);
void game_destroy();
public:
bool done = false;
int msg;
private:
Levi levi;
Menu menu;
Story story;
Story2 story2;
Frame frame;
Frame2 frame2;
ALLEGRO_BITMAP *icon;
ALLEGRO_BITMAP *game1;
ALLEGRO_BITMAP *game2;
ALLEGRO_BITMAP *run_1;
ALLEGRO_BITMAP *run_2;
ALLEGRO_BITMAP *tutorial_1;
ALLEGRO_BITMAP *fail;
ALLEGRO_BITMAP *win;
ALLEGRO_BITMAP *lose;
ALLEGRO_DISPLAY* display = NULL;
ALLEGRO_FONT *font = NULL;
ALLEGRO_FONT *Medium_font = NULL;
ALLEGRO_FONT *Large_font = NULL;
ALLEGRO_EVENT_QUEUE *event_queue = NULL;
ALLEGRO_EVENT event;
ALLEGRO_TIMER *timer = NULL;
ALLEGRO_SAMPLE *sample = NULL;
ALLEGRO_SAMPLE_INSTANCE *startSound = NULL;
ALLEGRO_SAMPLE_INSTANCE *clearSound = NULL;
ALLEGRO_SAMPLE_INSTANCE *failSound = NULL;
ALLEGRO_SAMPLE_INSTANCE *bgm1 = NULL;
ALLEGRO_SAMPLE_INSTANCE *bgm2 = NULL;
float transitionAlpha;
bool inTransition;
double transitionStartTime;
bool redraw = false;
bool mute = false;
bool showTutorial = true;
};
#endif // MAINWINDOW_H_INCLUDED