diff options
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/config/sounds.ts | 12 | ||||
-rw-r--r-- | src/engine/systems/Grid.ts | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/engine/config/sounds.ts b/src/engine/config/sounds.ts index b182c86..d6c564f 100644 --- a/src/engine/config/sounds.ts +++ b/src/engine/config/sounds.ts @@ -9,9 +9,7 @@ export const MovingSound: SoundSpec = { name: "moving", states: new Map([ [1, { name: "moving_1", url: "/assets/sound/move_1.wav" }], - // [2, { name: "moving_2", url: "/assets/sound/move_2.wav" }], - // [3, { name: "moving_3", url: "/assets/sound/move_3.wav" }], - [4, { name: "moving_4", url: "/assets/sound/move_4.wav" }], + [2, { name: "moving_2", url: "/assets/sound/move_2.wav" }], ]), }; @@ -69,6 +67,14 @@ export const Music: SoundSpec = { volume: 0.5, }, ], + [ + "home", + { + name: "home", + url: "/assets/sound/music/home.mp3", + volume: 0.5, + }, + ], ]), }; diff --git a/src/engine/systems/Grid.ts b/src/engine/systems/Grid.ts index 9ab28e3..1ec8ed9 100644 --- a/src/engine/systems/Grid.ts +++ b/src/engine/systems/Grid.ts @@ -116,7 +116,12 @@ export class Grid extends System { const moving = new Set<string>(); moving.add(entity.id); - while (!this.isOutOfBounds(nextGridPosition)) { + while (true) { + if (this.isOutOfBounds(nextGridPosition)) { + moving.clear(); + break; + } + const { x, y } = nextGridPosition; const entities = Array.from(this.grid[y][x]).map( (id) => game.getEntity(id)!, |