39 lines
1.0 KiB
C++
Executable File
39 lines
1.0 KiB
C++
Executable File
#ifndef PLAYERINTERFACE_HPP
|
|
#define PLAYERINTERFACE_HPP
|
|
|
|
#include "common.hpp"
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
const int kGridSize = 25;
|
|
|
|
namespace snakeplusplus
|
|
{
|
|
PlayerDirection GetPlayerInput(void);
|
|
|
|
class PlayerOutput
|
|
{
|
|
public:
|
|
sf::Vector2f gameBoundaries;
|
|
PlayerOutput(void);
|
|
bool IsOpen(void);
|
|
void CheckContinue(bool isBotControlled);
|
|
void DisplayGameState(std::vector< std::vector<char> >& gameBoard, int score);
|
|
void DisplayScore(int score);
|
|
void StartGameWindow(void);
|
|
private:
|
|
void CheckWindowEvents(void);
|
|
void DisplayEndScreen(void);
|
|
void DrawEmpty(sf::Vector2f location);
|
|
void DrawFood(sf::Vector2f location);
|
|
void DrawSnake(sf::Vector2f location);
|
|
sf::RenderWindow gameWindow;
|
|
sf::VideoMode gameVideoSettings;
|
|
sf::RectangleShape drawObject;
|
|
sf::Event event;
|
|
bool isWindowAlive;
|
|
sf::Time delay = sf::milliseconds(10);
|
|
};
|
|
}
|
|
|
|
#endif
|