Fix player idle sprite to face last walked direction instead of always facing forward

This commit is contained in:
Justin Oros
2026-05-21 09:05:38 -07:00
parent 1b25c2f92b
commit b6a7c6b088
+1 -1
View File
@@ -387,7 +387,7 @@ class Game {
/* Show the idle/middle frame for the last direction walked
Frames at 2× scale (32px each): down=32, up=128, left=224, right=320 */
const idleFrames = { right:'-32px', down:'-32px', left:'-128px', up:'-224px' };
p.style.backgroundPositionX = idleFrames[this.state.pathDir] || '-32px';
p.style.backgroundPositionX = idleFrames[this.state.lastDir] || '-32px';
}
}
}