summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/rogue/movementtransition.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/statemachine/rogue/movementtransition.h')
-rw-r--r--examples/statemachine/rogue/movementtransition.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h
index 1153b75..be15e38 100644
--- a/examples/statemachine/rogue/movementtransition.h
+++ b/examples/statemachine/rogue/movementtransition.h
@@ -68,7 +68,8 @@ protected:
int key = keyEvent->key();
return key == Qt::Key_2 || key == Qt::Key_8 || key == Qt::Key_6 ||
- key == Qt::Key_4;
+ key == Qt::Key_4 || key == Qt::Key_Down || key == Qt::Key_Up ||
+ key == Qt::Key_Right || key == Qt::Key_Left;
}
return false;
}
@@ -81,15 +82,19 @@ protected:
int key = keyEvent->key();
switch (key) {
+ case Qt::Key_Left:
case Qt::Key_4:
window->movePlayer(Window::Left);
break;
+ case Qt::Key_Up:
case Qt::Key_8:
window->movePlayer(Window::Up);
break;
+ case Qt::Key_Right:
case Qt::Key_6:
window->movePlayer(Window::Right);
break;
+ case Qt::Key_Down:
case Qt::Key_2:
window->movePlayer(Window::Down);
break;