From 34445c754034503659248fc1df9bbdc1347fbb1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Mon, 18 Oct 2021 13:25:25 +0200 Subject: [PATCH] Add Q for quit. --- lib/Game.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Game.cpp b/lib/Game.cpp index 6d9f864..d3333ab 100644 --- a/lib/Game.cpp +++ b/lib/Game.cpp @@ -40,6 +40,9 @@ void Game::processEvents(InputState & inputState) { if (sf::Keyboard::isKeyPressed(sf::Keyboard::A)) { inputState.enableAI = !inputState.enableAI; } + if (sf::Keyboard::isKeyPressed(sf::Keyboard::Q)) { + exit(0); + } inputState.down = sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Down); inputState.up = sf::Keyboard::isKeyPressed(sf::Keyboard::Key::Up);