This commit is contained in:
Schluffe
2026-03-21 14:59:35 +01:00
parent bb4a9f505b
commit fb36881847
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -99,8 +99,8 @@ export function drawSprite(
yStart,
sheet.frameWidth,
sheet.frameHeight,
x,
y,
Math.round(x),
Math.round(y),
width || sheet.frameWidth,
height || sheet.frameHeight,
);
+3 -2
View File
@@ -39,6 +39,7 @@ process((id, delta) => {
if (pointer.isDown) {
position.x = pointer.position.x;
position.y = pointer.position.y;
return;
}
velocity.x -= keyboardInput.arrowLeft ? 1 : 0;
@@ -48,8 +49,8 @@ process((id, delta) => {
normalize(velocity);
scale(velocity, speed);
position.x = Math.round(velocity.x * delta + position.x);
position.y = Math.round(velocity.y * delta + position.y);
position.x += velocity.x * delta;
position.y += velocity.y * delta;
velocity.x = 0;
velocity.y = 0;