-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathScreen.h
46 lines (42 loc) · 1.25 KB
/
Screen.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
#ifndef SCREEN
#define SCREEN
#include "Ghost.h"
#include "Player.h"
#include<vector>
#include<fstream>
#include <SFML/Audio.hpp>
#define row 21
#define col 17
class Screen
{
private:
int level;
int pellets[row][col];
RectangleShape board[row][col];
Player* pacman;
Ghost* ghosts;
Font font;
Text scoreHeader, playerHeader, levelHeader, score, levelText, player;
//vector <Text>high;
int pelletsNum; //The number of pellets in the game
Texture bricks, small_p, big_p, space, fruit1, fruit2, fruit3, fruit4, fruit5, fruit6;
vector <RectangleShape> fruit; //all the fruits that could be added
int fruitOrder; //Index to which fruit from the vector would be drawn next
bool fruitAdded; //whether to draw a fruit or not
Clock clydeTimer; //Timer to know when should clyde move
SoundBuffer eat;
Sound eatSound;
public:
Screen(Player& pac, Ghost[4]);
pair<bool,bool> updatePac(char&);
void updateGhosts(bool freight);
bool ghostCollision(); //if player collides with any ghost
void drawAll(RenderWindow&); //To draw all objects in class Screen
void setLevel(int);
int getLevel() { return level; }
void addFruit();
bool isFruitAdded() { return fruitAdded; }
void setPlayer(string n);
void UpdateScore();
};
#endif