Moved general functions to a general file
Moved general functions to a general file and added a statement to catch if the newly generated location is the same. The snake food is not currently generating to a new random location like expected and is broken.
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ GameState::GameState(int newHorizontal, int newVertical)
|
||||
void GameState::startNewGame()
|
||||
{
|
||||
gameWindow.create(gameVideoMode, "SnakePlusPlus");
|
||||
sf::Time delay = sf::milliseconds(50);
|
||||
sf::Time delay = sf::milliseconds(100);
|
||||
int snakeDirection = 0;
|
||||
Snake player(sf::Vector2f(25,25));
|
||||
SnakeFood playerFood(sf::Vector2f(25,25));
|
||||
|
||||
Reference in New Issue
Block a user