2022-08-02 21:58:58 -05:00
|
|
|
// SnakeFood.h
|
|
|
|
#ifndef SNAKEFOOD_H
|
|
|
|
#define SNAKEFOOD_H
|
2023-03-12 08:50:50 -05:00
|
|
|
|
2023-03-17 17:27:02 -05:00
|
|
|
#include <SFML/Graphics.hpp>
|
2023-03-12 21:57:46 -05:00
|
|
|
#include <random>
|
2023-03-12 08:50:50 -05:00
|
|
|
|
2022-08-02 21:58:58 -05:00
|
|
|
class SnakeFood
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SnakeFood();
|
2023-03-17 21:40:49 -05:00
|
|
|
void GenerateNewFood(sf::Vector2f boundaries);
|
|
|
|
sf::Vector2f GetFoodLocation(void);
|
2023-03-12 08:50:50 -05:00
|
|
|
protected:
|
|
|
|
;
|
|
|
|
private:
|
2023-03-17 20:13:50 -05:00
|
|
|
sf::Vector2f location;
|
2023-03-12 08:50:50 -05:00
|
|
|
std::default_random_engine generator;
|
2022-08-21 02:51:33 -05:00
|
|
|
int GenerateRandomNumber(int generationLimit);
|
2022-08-02 21:58:58 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|