diff --git a/app/ecs-systems/sprite-direction.js b/app/ecs-systems/sprite-direction.js index cdac1c3..7d7de44 100644 --- a/app/ecs-systems/sprite-direction.js +++ b/app/ecs-systems/sprite-direction.js @@ -14,7 +14,10 @@ export default class SpriteDirection extends System { const parts = []; if (entity.Controlled) { const {locked, moveUp, moveRight, moveDown, moveLeft} = entity.Controlled; - if (!locked && (moveUp > 0 || moveRight > 0 || moveDown > 0 || moveLeft > 0)) { + if (locked) { + continue; + } + if ((moveUp > 0 || moveRight > 0 || moveDown > 0 || moveLeft > 0)) { parts.push('moving'); } else { diff --git a/public/assets/hoe/start.js b/public/assets/hoe/start.js index 82a5685..96e8a00 100644 --- a/public/assets/hoe/start.js +++ b/public/assets/hoe/start.js @@ -1,11 +1,17 @@ -const {Controlled, Position, Wielder} = wielder +const {Controlled, Position, Sprite, Wielder} = wielder const {TileLayers} = ecs.get(1) const layer = TileLayers.layer(0) const projected = Wielder.project(Position.tile, item.tool.projection) Controlled.locked = 1; +const [, direction] = Sprite.animation.split(':'); -await wait(1000) +for (let i = 0; i < 2; ++i) { + Sprite.animation = ['moving', direction].join(':'); + await wait(300) + Sprite.animation = ['idle', direction].join(':'); + await wait(100) +} for (let i = 0; i < projected.length; ++i) { if ([1, 2, 3, 4].includes(layer.tile(projected[i]))) {