-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
38 lines (35 loc) · 873 Bytes
/
Game.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
#ifndef __GAME_H__
#define __GAME_H__
#include <SDL2/SDL.h>
class Game {
int WINDOW_WIDTH = 640; // 20 tiles
int WINDOW_HEIGHT = 480; // 15 tiles
int TILE_SIZE = 32;
SDL_Window* window;
SDL_Surface* windowSurface;
int tiles[300] = { 0 };
SDL_Rect entrancePosition;
SDL_Rect exitPosition;
SDL_Surface* gameMapSurface;
SDL_Rect playerPosition;
SDL_Event event;
Uint32 playerColor;
public:
Game();
void initialize();
void shutdown();
void createWindow();
void loadGameMap();
void printGameMap();
SDL_Surface* createGameMapSurface();
void setupGameMapSurface();
void paintEntrance(SDL_Surface* surface);
void paintExit(SDL_Surface* surface);
void run();
void handlePlayerInput();
void setPlayerPosition();
void setPlayerColor();
int mapCoordinateToTileId(SDL_Rect position);
bool isWalkableTile(int tileId);
};
#endif