Skip to content

Commit

Permalink
improve move check
Browse files Browse the repository at this point in the history
  • Loading branch information
awcz committed Apr 3, 2024
1 parent 54d8a75 commit b29112c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/Scene1.kt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Scene1 : Scene() {

private fun moveIfPossible(move: Point): Boolean {
val destination = player.pos + move
val isValidMove = collisions.getPixel(destination) != COLLISION_MARKER
val isValidMove = collisions.getPixel(destination + player.size) != COLLISION_MARKER
if (isValidMove) {
player.pos = destination
}
Expand Down

0 comments on commit b29112c

Please sign in to comment.