-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.hpp
44 lines (40 loc) · 1.01 KB
/
game.hpp
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
#ifndef game_hpp
#define game_hpp
#include<bits/stdc++.h>
#include <SDL2/SDL.h>
#include<SDL2/SDL_image.h>
#include<SDL2/SDL_ttf.h>
#include<SDL2/SDL_mixer.h>
#include "player.hpp"
#include "enemy.hpp"
using namespace std;
class Game{
private:
SDL_Window *window;
SDL_Renderer *renderer;
SDL_Texture* hlth;
SDL_Rect hlth_rect;
SDL_Color textColor;
SDL_Surface* surfacehlth;
Mix_Music *backgroundSound;
TTF_Font* hlthfont;
Player* player;
string player_name,phlth;
vector<Enemy*> enemies;
vector<string> scorelist;
fstream fin,fout;
bool isRunning, showPlayer, isShooting, isHS;
int mx,my,ecount=0;
long secount=0;
public:
Game();
~Game();
void start(const char* title,int x, int y, int w, int h, bool fs);
void event();
void display();
void createEnemy();
void end();
void over();
bool running(){ return isRunning;};
};
#endif