-
Notifications
You must be signed in to change notification settings - Fork 1
/
GameShell.h
64 lines (59 loc) · 1.43 KB
/
GameShell.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
#ifndef _GAMESHELL_H_
#define _GAMESHELL_H_
#include <SDL.h>
#include <vector>
#include <map>
#include <queue>
#include "Player.h"
#include "CollisionDetector.h"
#include "EventHandler.h"
#include "Enemy.h"
#include "Inventory.h"
#include "Tile.h"
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int TILE_WIDTH = 32;
const int TILE_HEIGHT = 32;
const int BAR_WIDTH = 100;
const int FPS = 30;
const int MAXTILES = 300;
const int TRANSPARENCY = 9;
const int CHASE_TRIGGER = 6;
const int ENEMY_PROXIMITY = 6;
class Tile;
struct CollisionDetector;
struct GameShell
{
unsigned int layerNumber;
SDL_Window* window;
SDL_Surface* screen;
SDL_Surface* tileset;
SDL_Surface* gameover;
SDL_Surface* lifebar;
SDL_Surface* gamewon;
std::map<int, SDL_Rect> bkgtiles;
std::vector<SDL_Rect> bartype;
std::vector<std::vector<Tile*> > tiles;
std::vector<int> itemlist;
Player bob;
CollisionDetector* col;
EventHandler actions;
Enemy zombie;
GameShell();
~GameShell();
void loadMap();
void refresh();
void repaintTile(SDL_Rect& coord);
void action();
bool deductHealth(unsigned int value);
bool isItem(int value);
void updateLifebar(SDL_Surface* screen);
void gameOver();
void gameWon();
Tile* findPath(Tile*& start, Tile*& goal);
void mark();
bool near_exit(Player& player);
bool near_player(Player& player);
SDL_Rect exit;
};
#endif