Added random generation on start
This commit is contained in:
parent
709cf26f99
commit
441c52ab0f
@ -100,10 +100,9 @@ namespace snakeplusplus
|
||||
char* locationState = &gameBoard.at(player.headLocation.y).at(player.headLocation.x);
|
||||
player.body.push(locationState);
|
||||
*player.body.front() = 'O';
|
||||
playerFood.location.x = 2;
|
||||
playerFood.location.y = 2;
|
||||
playerFood.food = &gameBoard.at(2).at(2);
|
||||
*playerFood.food = 'X';
|
||||
playerFood.GenerateNewFood(GetGameBoundaries());
|
||||
sf::Vector2f newLocation = playerFood.location;
|
||||
gameBoard.at(newLocation.y).at(newLocation.x) = 'X';
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user