// Snake.cpp #include #include #include "common.hpp" #include "snake.hpp" void Snake::Pop(void) { *(body.front()) = ' '; body.pop(); return; } void Snake::Reset(void) { while (!body.empty()) Pop(); speed.x = 0; speed.y = 0; return; } // Returns a new food object for the snakeFood void Food::GenerateNewFood(sf::Vector2f boundaries) { location.x = GenerateRandomNumber(boundaries.x); location.y = GenerateRandomNumber(boundaries.y); return; }