[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 texture = new Texture(__dirname + "/../../res/images/tilemap.png");
|
||||||
const sounds = {
|
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");
|
const Pointer = require("./pointer.js");
|
||||||
@ -67,6 +68,7 @@ class Chest extends TileSprite {
|
|||||||
this.state = state.open;
|
this.state = state.open;
|
||||||
this.pressed = true;
|
this.pressed = true;
|
||||||
this.action();
|
this.action();
|
||||||
|
sounds.obtain.play();
|
||||||
} else {
|
} else {
|
||||||
if (!sounds.forbidden.playing && !this.pressed) {
|
if (!sounds.forbidden.playing && !this.pressed) {
|
||||||
sounds.forbidden.play();
|
sounds.forbidden.play();
|
||||||
|
Loading…
Reference in New Issue
Block a user