-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameState.hpp
41 lines (37 loc) · 1.11 KB
/
GameState.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
#ifndef GAME_STATE_HPP
#define GAME_STATE_HPP
#include <SFML/Graphics.hpp>
#include "State.hpp"
#include "Game.hpp"
#include "Board.hpp"
namespace Checkers {
class GameState : public State {
public:
GameState(GameDataRef data, int mode);
void init();
void handleInput();
void update(float dt);
void render(float dt);
void initPosition();
private:
Board* _mboard;
GameDataRef _data;
void initStats(sf::Text&, int, int);
sf::Sprite _board, _figures[24], _outerBoard;
sf::Vector2f offset = sf::Vector2f(28, 28);
sf::Text _text, _wcount, _bcount, _gameover,_savegame;
sf::RectangleShape rectangle;
int bcount=0, wcount=0;
bool moving=false;
float dx=0, dy=0;
int temp=24;
sf::Vector2f currentPosition, newPos;
std::string str;
int _selectedPieceIndex;
int gamemode;
int savemode=0;
void showGameOver();
void checkConditionall();
};
}
#endif