This commit is contained in:
nelle 2023-10-29 20:29:54 -06:00
parent 4806ac3170
commit ac29f0267e

View file

@ -23,7 +23,7 @@ object InputReceiver : BaseBehavior<GameContext>() {
if (uiEvent is KeyboardEvent) {
// We use when which is similar to switch in Java to check which key was pressed.
// Zircon has a KeyCode for all keys which can be pressed. when in Kotlin is also an expression,
// and not a statement so it returns a value. We can change it into our newPosition variable.
// and not a statement, so it returns a value. We can change it into our newPosition variable.
val newPosition = when (uiEvent.code) {
KeyCode.KEY_W -> currentPos.withRelativeY(-1)