[sounds]: Linked obtain sound to chest opening
This commit is contained in:
parent
4e2928bd7f
commit
643ca24bad
Binary file not shown.
@ -4,7 +4,8 @@ const { Texture, Sound, TileSprite, entity } = asdf;
|
||||
|
||||
const texture = new Texture(__dirname + "/../../res/images/tilemap.png");
|
||||
const sounds = {
|
||||
forbidden: new Sound(__dirname + "/../../res/sounds/forbidden.wav")
|
||||
forbidden: new Sound(__dirname + "/../../res/sounds/forbidden.wav"),
|
||||
obtain: new Sound(__dirname + "/../../res/sounds/obtain.wav")
|
||||
};
|
||||
|
||||
const Pointer = require("./pointer.js");
|
||||
@ -67,6 +68,7 @@ class Chest extends TileSprite {
|
||||
this.state = state.open;
|
||||
this.pressed = true;
|
||||
this.action();
|
||||
sounds.obtain.play();
|
||||
} else {
|
||||
if (!sounds.forbidden.playing && !this.pressed) {
|
||||
sounds.forbidden.play();
|
||||
|
Loading…
Reference in New Issue
Block a user