Added text box to portals
This commit is contained in:
parent
0ee8ca5b30
commit
c6bc46b961
@ -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!"
|
||||
}
|
||||
};
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user