aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/cpp/Subconscious.cpp
diff options
context:
space:
mode:
authormafaldo <mafaldo@heavyhammer.home>2018-02-12 19:27:49 +0100
committermafaldo <mafaldo@heavyhammer.home>2018-02-12 19:27:49 +0100
commit07ac0fe25109717d4d7f9bcc7ae313a25b839cb0 (patch)
tree509c740828e2cae12e8e5de48c13219349d43d3b /src/main/cpp/Subconscious.cpp
parentEdit makefile to build and run c++ by default (diff)
downloadSubconscious-old-07ac0fe25109717d4d7f9bcc7ae313a25b839cb0.tar.gz
Subconscious-old-07ac0fe25109717d4d7f9bcc7ae313a25b839cb0.zip
add pan
Diffstat (limited to '')
-rw-r--r--src/main/cpp/Subconscious.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/cpp/Subconscious.cpp b/src/main/cpp/Subconscious.cpp
index b53a38b..542e580 100644
--- a/src/main/cpp/Subconscious.cpp
+++ b/src/main/cpp/Subconscious.cpp
@@ -32,6 +32,22 @@ void Subconscious::run()
switch (event.type) {
/*** Keyboard Events ***/
case sf::Event::KeyPressed:
+ switch (event.key.code) {
+ case sf::Keyboard::Up:
+ _currentScene->pan(0, 10);
+ break;
+ case sf::Keyboard::Down:
+ _currentScene->pan(0, -10);
+ break;
+ case sf::Keyboard::Left:
+ _currentScene->pan(10, 0);
+ break;
+ case sf::Keyboard::Right:
+ _currentScene->pan(-10, 0);
+ break;
+ default:
+ break;
+ }
break;
case sf::Event::KeyReleased:
@@ -66,6 +82,8 @@ void Subconscious::run()
case sf::Event::Resized:
_currentScene->resize(event.size);
break;
+ default:
+ break;
}
}