examples/raycasting: fix bug, swap height and width (#1067)

This commit is contained in:
Sam Oen 2020-02-01 16:28:23 +08:00 committed by GitHub
parent ad84bf812f
commit 69dc54232c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,16 +187,16 @@ func handleMovement() {
} }
// +1/-1 is to stop player before it reaches the border // +1/-1 is to stop player before it reaches the border
if px >= screenHeight-padding { if px >= screenWidth-padding {
px = screenHeight - padding - 1 px = screenWidth - padding - 1
} }
if px <= padding { if px <= padding {
px = padding + 1 px = padding + 1
} }
if py >= screenWidth-padding { if py >= screenHeight-padding {
py = screenWidth - padding - 1 py = screenHeight - padding - 1
} }
if py <= padding { if py <= padding {