2023-04-06 19:27:10 -05:00
|
|
|
// Snake.h
|
|
|
|
#ifndef SNAKE_HPP
|
|
|
|
#define SNAKE_HPP
|
|
|
|
|
2023-04-06 22:22:06 -05:00
|
|
|
#include <SFML/System/Vector2.hpp>
|
2023-04-06 19:27:10 -05:00
|
|
|
#include <queue>
|
2024-08-02 21:23:49 -05:00
|
|
|
#include "common.hpp"
|
2023-04-06 19:27:10 -05:00
|
|
|
|
2024-08-02 19:45:07 -05:00
|
|
|
struct Snake
|
2023-04-06 19:27:10 -05:00
|
|
|
{
|
2024-08-02 19:45:07 -05:00
|
|
|
public:
|
|
|
|
sf::Vector2f headLocation;
|
|
|
|
sf::Vector2f speed;
|
2024-08-02 21:23:49 -05:00
|
|
|
std::queue<GameSpace*> body;
|
2024-08-02 19:45:07 -05:00
|
|
|
void Pop(void);
|
|
|
|
void Reset(void);
|
|
|
|
};
|
2023-04-06 19:27:10 -05:00
|
|
|
|
2024-08-02 19:45:07 -05:00
|
|
|
struct Food
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
sf::Vector2f location;
|
|
|
|
void GenerateNewFood(sf::Vector2f boundaries);
|
|
|
|
};
|
2023-04-06 19:27:10 -05:00
|
|
|
|
|
|
|
#endif
|