-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameEngine.h
84 lines (62 loc) · 1.69 KB
/
GameEngine.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
#ifndef _GAMEENGINE_H_
#define _GAMEENGINE_H_
#include<iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <fstream>
#include <chrono>
#include <thread>
#include "SDL2/SDL.h"
#include "SDL2/SDL_image.h"
#include "SDL2/SDL_timer.h"
#include "SDL2/SDL_ttf.h"
#include "SDL2/SDL_mixer.h"
#include "TextureManager.h"
#include "GameObject.h"
#include "Enemy.h"
#include "TileMap.h"
#include "SpriteManager.h"
#include "ScreenManager.h"
#include "SoundManager.h"
extern Uint32 frameStart;
extern const int LEVEL_WIDTH;
extern const int LEVEL_HEIGHT;
//Screen dimension constants
extern const int SCREEN_WIDTH;
extern const int SCREEN_HEIGHT;
//IMG size constants
extern const int MC_IMG_SRC;
extern const int MC_IMG_DEST;
extern bool flag_allowmove;
extern bool flag_left;
extern int leftcount; //for left movement
extern int rightcount; //for right movement
extern int esccount;
extern bool flag_right;
extern int start; // to place the player in starting position
extern bool flag_kick;
extern bool flag_punch; // for player punching
extern bool flag_hit; // for player getting hit
extern bool paused;
//character step on xaxis
extern const int STEPX;
extern SDL_Event input;
class GameEngine
{
public:
GameEngine();
~GameEngine();
int initGameEngine(const char* title, int xpos, int ypos, int width, int height, bool isFullscreen);
void handleGameEngineEvents();
void updateGameEngine(SDL_Rect& cameraRect);
void renderGameEngine(SDL_Rect& cameraRect);
void cleanGameEngine();
bool running(){ return isRunning;}
static SDL_Renderer* renderer;
private:
bool isRunning = false;
SDL_Window* window;
};
#endif