X-Git-Url: http://git.megabrutal.com/?p=wgj58.git;a=blobdiff_plain;f=wgj58.js;h=2c503f0829a15065ad0859591ef4640b72353a0f;hp=42f0485de13536a5f19d35ba46c496e6741f782a;hb=4d2391f1beff1a3168bc19d05ab2c5913b63d588;hpb=4b97e8fd47a41ea7fcd5c37d372370bc78f49da5 diff --git a/wgj58.js b/wgj58.js index 42f0485..2c503f0 100644 --- a/wgj58.js +++ b/wgj58.js @@ -172,7 +172,7 @@ class GameNPC extends Phaser.Sprite { this.fullname = fullname; this.interaction_distance = interaction_distance; this.interactable = false; - this.talkcount = 0; + this.resetTalk(); this.happy = false; } @@ -218,6 +218,10 @@ class GameNPC extends Phaser.Sprite { return true; } + resetTalk() { + this.talkcount = 0; + } + makeHappy() { this.happy = true; console.log(this.shortname, "is happy!"); @@ -528,7 +532,7 @@ class NPC_Saiki extends GameNPC { class NPC_Peter extends GameNPC { actionTalk() { - if (logic.carlos.alive) { + if (logic.saiki.alive) { switch (this.talkcount) { case 0: logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Hi Peter! What's up?" }, @@ -715,8 +719,7 @@ class GameInterface extends Phaser.Group { this.back_notice.drawRect(0, 0, game.width, 30); this.back_notice.endFill(); this.add(this.back_notice); - this.text_notice = new Phaser.Text(game, 0, this.back_notice.y, null, { align: 'left', fill: 'white', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' }); - this.text_notice.anchor.setTo(-0.5, -0.2); + this.text_notice = new Phaser.Text(game, 125, this.back_notice.y + 5, null, { align: 'left', fill: 'white', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' }); this.add(this.text_notice); this.clearNotice();