2022-07-25 15:40:45 -05:00
|
|
|
//Snake.h
|
|
|
|
#ifndef SNAKE_H
|
|
|
|
#define SNAKE_H
|
|
|
|
#include <queue>
|
|
|
|
|
|
|
|
bool SnakeCollision(sf::RectangleShape object1, sf::RectangleShape object2);
|
|
|
|
void SnakeMovement(sf::Keyboard keyboard);
|
|
|
|
|
2022-07-25 15:43:42 -05:00
|
|
|
// class SnakeNode
|
|
|
|
// {
|
|
|
|
// private:
|
|
|
|
// // sf::RectangleShape snakeBody(sf::Vector2f(25,25));
|
|
|
|
// sf::Vector2f snakeBodyLocation;
|
|
|
|
// SnakeNode* next;
|
|
|
|
// public:
|
|
|
|
// SnakeNode();
|
|
|
|
// SnakeNode(sf::Vector2f addBodyPiece);
|
|
|
|
// };
|
2022-07-25 15:40:45 -05:00
|
|
|
|
|
|
|
class Snake
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::deque<sf::Vector2f> snakeBody;
|
|
|
|
public:
|
|
|
|
void ExtendSnake(sf::Vector2f newLocation);
|
|
|
|
void MoveSnake();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|