-
Notifications
You must be signed in to change notification settings - Fork 0
/
Board.h
55 lines (45 loc) · 1.13 KB
/
Board.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
//Group Names: ABDELRAHMAN SAID, MOSTAFA IBRAHIM, MOHAMED FAKHERLDIN
#pragma once
#include <iostream>
#include <fstream>
#include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
enum tile_type { empty, pellet, power, wall, ghost };
struct Fruit
{
Sprite f;
Texture fruitTexture;
bool edible;
};
struct cell {
RectangleShape r; //Board tiles
tile_type t;
//bool standable; //A bool flag to check whether pacman can step over this cell or no.
//bool eaten; //A bool flag to check whether a pellet was eaten or not.
};
class Board
{
private:
ifstream input;
cell board[21][17];
Fruit fruit;
Texture bricktexture;
Texture pelletTexture;
Texture superPelletTexture;
Texture ghostChamberDoorTexture;
public:
int arr[21][17];
Board();
bool isStandable(int row, int col) const;
bool isEaten(int row, int col);
bool ispower(int row, int col);
void setFruitEdible(bool condition);
bool isFruitEdible() const;
RectangleShape getRectangle(int row, int col);
void eaten(int row, int col);
Sprite getFruit();
void drawOnWindow(RenderWindow& window);
void drawFruit(RenderWindow& window);
//void resetPellets();
};