Skip to content

Commit 4972615

Browse files
committed
fix: reset sub-pixel movement remainders on collision
1 parent a1e52d3 commit 4972615

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/player/Actor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export abstract class Actor extends Entity {
4646
}
4747

4848
collided = true;
49+
this.remX = 0;
4950
const result = this.onCollideH(step);
5051
if (result === "moved") {
5152
move -= step;
@@ -87,6 +88,7 @@ export abstract class Actor extends Entity {
8788
}
8889

8990
collided = true;
91+
this.remY = 0;
9092
const result = this.onCollideV(step);
9193
if (result === "moved") {
9294
move -= step;

0 commit comments

Comments
 (0)