X-Git-Url: http://git.megabrutal.com/?p=wgj58.git;a=blobdiff_plain;f=wgj58.js;h=d737ad82fe0fb9f347e980b5c4453eeeee663870;hp=b3f6ac13743ee93606539ac2030ff31dbc0e1c83;hb=0ed641e27ca4e7cdd8edea041dd207a1aa3fd77c;hpb=d493781f63495c7400d2dd03f2a2e7cfdfe2bdfe diff --git a/wgj58.js b/wgj58.js index b3f6ac1..d737ad8 100644 --- a/wgj58.js +++ b/wgj58.js @@ -160,7 +160,7 @@ class Player extends Phaser.Sprite { this.loadTexture(npc.key); npc.kill(); this.disguise = npc; - logic.gameinterface.dropNotice("You are now identified as " + npc.fullname + "!"); + logic.gameinterface.dropNoticeTimeout(Phaser.Timer.SECOND * 5, "You are now identified as " + npc.fullname + "!"); } } @@ -593,6 +593,11 @@ class GameInterface extends Phaser.Group { this.text_notice.visible = true; } + dropNoticeTimeout(timeout, text) { + this.dropNotice(text); + game.time.events.add(timeout, this.clearNotice, this); + } + clearNotice() { this.back_notice.visible = false; this.text_notice.visible = false;