-
Notifications
You must be signed in to change notification settings - Fork 1
/
Game.hpp
47 lines (43 loc) · 1.03 KB
/
Game.hpp
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
#ifndef SNAKE_RG_GAME_H_
#define SNAKE_RG_GAME_H_
#include "Snake.hpp"
#include "Food.hpp"
#include "Base.hpp"
#include "GameObject.hpp"
#include "Global.hpp"
#include "WindowRender.hpp"
#include "AnimationManager.hpp"
#include <SFML/Graphics.hpp>
namespace rg {
class Game {
private:
sf::RenderWindow* window;
renderManager* m_renderManager;
Snake* m_game_snake;
Food* m_game_food;
Wall* m_wall;
Background* m_background;
AnimationSnake* A1;
AnimationFade* A2;
int m_outgame_size, m_ingame_width, m_ingame_height, m_snake_size;
float m_game_speed;
int score = 0;
sf::Clock gameclock;
float gameTime = 0.0f;
float move_per_time = 0.1f;
bool pause = false;
bool isInFood();
void AteFood();
void genFood();
void handleEvent();
void displayGaming();
void displayA1();
void displayA2();
public:
explicit Game(sf::RenderWindow& window, renderManager& render, BaseData data, float game_speed);
~Game() = default;
void display();
int getScore();
};
}
#endif