-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
36 lines (31 loc) · 1019 Bytes
/
Player.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
/*----------------------------------------------------------------------------------------------*/
/* Represents Pacman in the game
* Inherits from gameObject
*/
#pragma once
#include "GameObject.h"
#include "utils.h"
#include "Const.h"
class Player : public GameObject {
private:
int Lives;
int Points;
char direction;
int Food;
public:
Player(int x = 0, int y = 0, int points = 0, int lives = Starting_Lives, char dir = STAY, int Food = 0) : GameObject(x, y) { direction = dir; Points = points; Lives = lives; this->Food = Food; };
char getDirection() const;
void setDirection(char dir);
bool checkLegalMove(char direction, char board[][terminal_Size_X]);
int getLives() const;
void setLives(int newLives);
int getPoints() const;
void addAPoint();
int getFood() const;
void addAFood();
void zeroFood();
void move(char dir, char board[][terminal_Size_X], bool withColor, vector<GameObject> secretPaths, bool silentMode = NORMAL);
void draw();
void Delete();
GameObject getPosition() const;
};