add misc features to game #5

Merged
Trianta merged 4 commits from iterative into master 2024-08-02 19:36:15 -05:00
Showing only changes of commit 22da054dab - Show all commits

View File

@ -134,6 +134,14 @@ namespace snakeplusplus
if ((event.type == sf::Event::Closed) if ((event.type == sf::Event::Closed)
|| (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))) || (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)))
gameWindow.close(); gameWindow.close();
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Equal)) {
if (delay > sf::milliseconds(16)) { continue; }
delay += sf::milliseconds(1);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Hyphen)) {
if (delay == sf::milliseconds(0)) { continue; }
delay -= sf::milliseconds(1);
}
} }
} }