Skip to content

Commit 732831c

Browse files
committed
fixed glitching into blocks weirdly when in a one block height gap
1 parent 06d3dd5 commit 732831c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/javascript/platformer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ function updatePhysics(dt) {
992992

993993
let maxPush = 0.5
994994
while (checkCollision(dt, player.x + offX + (dir * maxPush), player.y + offY, player.hitboxW, player.hitboxH, true) && maxPush < player.tileSize) {
995-
maxPush *= 2
995+
maxPush += 2
996996
}
997997

998998
let minPush = 0
@@ -1032,7 +1032,7 @@ function updatePhysics(dt) {
10321032

10331033
let maxPush = 0.5
10341034
while (checkCollision(dt, player.x + offX + 0.05, player.y + offY + (dir * maxPush), player.hitboxW - 0.1, player.hitboxH, true) && maxPush < player.tileSize) {
1035-
maxPush *= 2
1035+
maxPush += 0.5
10361036
}
10371037

10381038
let minPush = 0

0 commit comments

Comments
 (0)