aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/cpp/Subconscious.cpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2018-02-12 19:40:13 +0100
committerNao Pross <naopross@thearcway.org>2018-02-12 19:40:13 +0100
commitf8ca0da580a1589742a541a14b530e39282a5c9b (patch)
tree1758eb024bcad447f24d758e0fc4c295f0468933 /src/main/cpp/Subconscious.cpp
parentFix zoom bug, add Scene.type member (diff)
parentadd pan (diff)
downloadSubconscious-old-f8ca0da580a1589742a541a14b530e39282a5c9b.tar.gz
Subconscious-old-f8ca0da580a1589742a541a14b530e39282a5c9b.zip
Merge mafaldo's work
Diffstat (limited to '')
-rw-r--r--src/main/cpp/Subconscious.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/cpp/Subconscious.cpp b/src/main/cpp/Subconscious.cpp
index a4f6128..9765f2f 100644
--- a/src/main/cpp/Subconscious.cpp
+++ b/src/main/cpp/Subconscious.cpp
@@ -32,6 +32,34 @@ void Subconscious::run()
switch (event.type) {
/*** Keyboard Events ***/
case sf::Event::KeyPressed:
+ switch (event.key.code) {
+ case sf::Keyboard::Up:
+ if (_currentScene->type == Scene::Type::WORLD) {
+ static_cast<WorldScene*>(_currentScene)->pan(0, 10);
+ }
+ break;
+
+ case sf::Keyboard::Down:
+ if (_currentScene->type == Scene::Type::WORLD) {
+ static_cast<WorldScene*>(_currentScene)->pan(0, -10);
+ }
+ break;
+
+ case sf::Keyboard::Left:
+ if (_currentScene->type == Scene::Type::WORLD) {
+ static_cast<WorldScene*>(_currentScene)->pan(10, 0);
+ }
+ break;
+
+ case sf::Keyboard::Right:
+ if (_currentScene->type == Scene::Type::WORLD) {
+ static_cast<WorldScene*>(_currentScene)->pan(-10, 0);
+ }
+ break;
+
+ default:
+ break;
+ }
break;
case sf::Event::KeyReleased: