diff --git a/res/lang/default.js b/res/lang/default.js index f4f9acd..c3efd71 100644 --- a/res/lang/default.js +++ b/res/lang/default.js @@ -25,7 +25,6 @@ module.exports = { lives: "Lives", stamina: "Stamina", keyFind: "You found a key!", - keyMiss: "You do not have the key for this door!", - chestOpen: "You already opened this chest" + keyMissing: "You do not have the key for this door!" } }; \ No newline at end of file diff --git a/src/entities/portal.js b/src/entities/portal.js index 8f76438..c20bc18 100644 --- a/src/entities/portal.js +++ b/src/entities/portal.js @@ -7,6 +7,9 @@ const sounds = { forbidden: new Sound(__dirname + "/../../res/sounds/forbidden.wav") }; +const TextBox = require(__dirname + "/../helpers/textbox.js"); +const text = require(__dirname + "/../../res/lang/default.js"); + var Pointer = require("./pointer.js"); class Portal extends TileSprite { @@ -90,6 +93,7 @@ class Portal extends TileSprite { this.pointer.anims.play("red"); if (this.keys.action) { if (!sounds.forbidden.playing && !this.pressed) { + this.level.entities.add(new TextBox(text.game.keyMissing, 2.5)); sounds.forbidden.play(); this.pressed = true; }