snakeplusplus/include/gamestate.h

34 lines
677 B
C
Raw Normal View History

// GameState.h
#ifndef GAMESTATE_H
#define GAMESTATE_H
2023-03-12 08:50:50 -05:00
#include <memory>
#include <SFML/Graphics.hpp>
#include "snake.h"
#include "display.h"
class GameState
{
public:
std::vector< std::vector<char> > gameBoard;
bool useSFML = 1;
GameState();
2023-03-12 08:50:50 -05:00
void StartGame(void);
sf::Vector2f GetGameBoundaries(void);
protected:
;
private:
std::unique_ptr<DisplayInterface> graphics;
2023-03-12 08:50:50 -05:00
SnakeFood playerFood;
Snake player;
void DisplayEndScreen(void);
void GetKeyboardInput(void);
bool PlayerWantsToContinue(void);
2023-03-12 08:50:50 -05:00
void RegenerateFood(void);
void ResetGameBoard(void);
2023-03-12 08:50:50 -05:00
void RunGameLoop(void);
void RenderWindow(void);
};
#endif