-
Notifications
You must be signed in to change notification settings - Fork 0
/
Avatar.h
54 lines (43 loc) · 889 Bytes
/
Avatar.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
#ifndef AVATAR_H_INCLUDED
#define AVATAR_H_INCLUDED
#include <iostream>
#include <conio.h>
#include <stdexcept>
#include "ConsoleController.h"
#include "Direction.h"
#include "Map.h"
#define UP_W 119
#define DOWN_S 115
#define LEFT_A 97
#define RIGHT_D 100
#define UP_ARROW 72
#define DOWN_ARROW 80
#define LEFT_ARROW 75
#define RIGHT_ARROW 77
using namespace std;
class Avatar {
private:
int xBorder;
int yBorder;
int x;
int y;
char** map2dArray;
bool isKeyAllowed(const int KEY);
void moveUp();
void moveDown();
void moveLeft();
void moveRight();
void winCheck();
void bombCheck();
void printYouWin();
bool isWallAt(Direction direction);
public:
static const char ANDICATOR = 'X';
Avatar(int xBorder ,int yBorder);
~Avatar();
void getBack();
void move(const int KEY);
void draw();
void setMap(char** map2dArray);
};
#endif