2022-07-28 15:18:24 -05:00
|
|
|
// Snake.h
|
2022-07-25 15:40:45 -05:00
|
|
|
#ifndef SNAKE_H
|
|
|
|
#define SNAKE_H
|
|
|
|
|
2023-03-17 20:13:50 -05:00
|
|
|
#include <queue>
|
2023-03-17 17:27:02 -05:00
|
|
|
#include <SFML/Graphics.hpp>
|
2023-02-26 18:18:45 -06:00
|
|
|
|
2022-07-25 15:40:45 -05:00
|
|
|
|
|
|
|
class Snake
|
|
|
|
{
|
|
|
|
public:
|
2023-03-12 21:57:46 -05:00
|
|
|
Snake(void);
|
2023-03-17 20:13:50 -05:00
|
|
|
sf::Vector2f MoveSnake(void);
|
|
|
|
sf::Vector2f Pop(void);
|
2023-03-12 21:57:46 -05:00
|
|
|
void UpdateDirection(int newDirection);
|
2023-03-12 08:50:50 -05:00
|
|
|
protected:
|
|
|
|
;
|
|
|
|
private:
|
2023-03-17 20:13:50 -05:00
|
|
|
std::queue<sf::Vector2f> snakeBody;
|
2023-03-12 08:50:50 -05:00
|
|
|
int snakeDirection = 0;
|
2023-03-17 20:13:50 -05:00
|
|
|
sf::Vector2f CalculateNewHead();
|
|
|
|
void CreateNewHead(sf::Vector2f);
|
2022-07-25 15:40:45 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|