From 8080ff87067a631fd706f632a1802d4ef0b63876 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 11 Jun 2014 23:08:07 -0700 Subject: [PATCH] Word bubbles --- moonlight/js/moonlight-skulk.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index ed1c72d..f8dd4ad 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -296,6 +296,7 @@ var AISprite = function(game, x, y, spritetype) { var mylines = moonlightDialog['status'][this.sprite_group][aistate]; this.bubble_text = mylines[game.rnd.integerInRange(0, mylines.length)]; this.bubble_style = {font: '12px Arial Bold', fill: '#ffffff', align: 'center'} + this.bubble = game.add.text(this.x, this.y - 20, this.bubble_text, this.bubble_style); } this.clearWordBubble = function() @@ -319,8 +320,9 @@ var AISprite = function(game, x, y, spritetype) { if ( this.bubble !== null ) { this.bubble.destroy(); - this.bubble = game.add.text(this.x, this.y - 20, text, style); + this.bubble = game.add.text(this.x, this.y - 20, this.bubble_text, this.bubble_style); } + switch ( game.rnd.integerInRange(0, 4) ) { case 0: { setSpriteMovement(this, running, 'up');