snakeplusplus/src/playerinterface.hpp

38 lines
999 B
C++
Raw Normal View History

#ifndef PLAYERINTERFACE_HPP
#define PLAYERINTERFACE_HPP
#include "common.hpp"
#include <SFML/Graphics.hpp>
const int kGridSize = 25;
namespace snakeplusplus
{
2023-08-14 17:39:04 -05:00
PlayerDirection GetPlayerInput(void);
class PlayerOutput
{
public:
sf::Vector2f gameBoundaries;
PlayerOutput(void);
bool IsOpen(void);
2023-08-19 23:32:53 -05:00
void CheckContinue(bool isBotControlled);
2023-04-15 05:15:11 -05:00
void DisplayGameState(std::vector< std::vector<char> >& gameBoard);
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;
2023-08-19 23:32:53 -05:00
sf::Event event;
bool isWindowAlive;
2023-10-13 19:07:08 -05:00
sf::Time delay = sf::milliseconds(5);
};
}
#endif