Got some keys mixed up

This commit is contained in:
nelle 2023-11-06 03:07:11 -07:00
parent 0f70d1e8f1
commit b642879da4

View file

@ -28,8 +28,8 @@ object InputReceiver : BaseBehavior<GameContext>() {
val newPosition = when (uiEvent.code) { val newPosition = when (uiEvent.code) {
KeyCode.KEY_W -> currentPos.withRelativeY(-1) KeyCode.KEY_W -> currentPos.withRelativeY(-1)
KeyCode.KEY_A -> currentPos.withRelativeX(-1) KeyCode.KEY_A -> currentPos.withRelativeX(-1)
KeyCode.KEY_D -> currentPos.withRelativeY(1) KeyCode.KEY_S -> currentPos.withRelativeY(1)
KeyCode.KEY_S -> currentPos.withRelativeX(1) KeyCode.KEY_D -> currentPos.withRelativeX(1)
else -> { else -> {
// If some key is pressed other than WASD, then we just return the current position, so no movement will happen // If some key is pressed other than WASD, then we just return the current position, so no movement will happen
currentPos currentPos