snakeplusplus/src/SnakeFood.h
TriantaTV 2c4537eda7 Fixed generation issue with snakeFood
Fixed generation issue with snakeFood and game should be fully playable without an official end screen implemented. So when the snake gets stuck or the game finishes, there is nothing to close the game automatically.
2022-08-21 02:51:33 -05:00

20 lines
418 B
C++

// SnakeFood.h
#ifndef SNAKEFOOD_H
#define SNAKEFOOD_H
#include <random>
#include <SFML\Graphics.hpp>
class SnakeFood
{
private:
public:
sf::RectangleShape snakeFoodObject;
std::default_random_engine generator;
SnakeFood();
SnakeFood(sf::Vector2f snakeFoodSize);
void GenerateNewLocation(int horizontalLocation, int verticalLocation);
int GenerateRandomNumber(int generationLimit);
};
#endif