WIP
This commit is contained in:
+2
-2
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user