-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
109 lines (86 loc) · 1.71 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#pragma once
#include "PlayerPac.h"
#include"Ghost_draw.h"
#include "Ghost_types.h"
class Game
{
private:
sf::VideoMode videoMode;
sf::RenderWindow* window;
PlayerPac* pac;
bool endGame;
sf::Event ev;
sf::Texture wall;
sf::Texture dot;
sf::Texture gate;
sf::Sprite spriteWall;
sf::Sprite spriteDot;
sf::Sprite spriteGate;
sf::Sprite spriteEnergizer;
sf::Font font;
sf::Text scoreText;
sf::Text scoreVal;
sf::Text pacmanText;
sf::SoundBuffer chomp;
sf::SoundBuffer start;
sf::Sound soundChomp;
sf::Sound soundStart;
int check;
int index_check;
/////////////////////
Ghost_draw* blinkydraw;
Ghost_draw* pinkydraw;
Ghost_draw* inkydraw;
Ghost_draw *clydedraw;
Blinky* blinky;
Pinky* pinky;
Clyde* clyde;
Inky* inky;
long frame;
Position gameG_Pos;
void frame_rt_AllGhost();
void Blinky_Decide();
void pinky_Decide();
void inky_Decide();
void clyde_Decide();
void setGhost();
//..................
void ghostMoveDecide();
void ghostAllMove();
void checkGhostCollide();
void chaseAllGhosts();
void scatterAllGhost();
void frighten_endAllghost();
void movingGhost();
char direction;
int pacx ;
int pacy ;
void initVariables();
void initWindow();
public:
//int** Map;
void eatenCheck();
//Constructors & Destructors
Game();
//Game(int map[31][28]);
~Game();
//Accessors
//Modifiers
//Functions
const bool running() const;
void pollEvents();
void updatePlayer();
void renderPlayer();
void renderghost();
void initTexture();
void initSprite();
void initFont();
void initSound();
void frighten_end(bool& scared, bool& powered);
void DrawMap();
void update();
void render();
void move();
void collectDot(int x,int y);
const sf::RenderWindow& getWindow() const;
};