From 8a1d3aaa077e1c2b3980242776f958a3ea44a813 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 12 Jun 2014 00:11:08 -0700 Subject: [PATCH] Word bubbles --- moonlight/js/moonlight-skulk.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 3486d4d..7f2628d 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -322,6 +322,11 @@ Light.prototype = Object.create(Phaser.Sprite.prototype); Light.prototype.constructor = Light; var AISprite = function(game, x, y, spritetype) { + this.GOFUCKYERSELF = function() { + this.clear_bubble = true; + console.log("GOFUCKYERSELF fired"); + } + this.setWordBubble = function() { if ( this.bubble !== null || this.sprite_group == undefined) { @@ -353,12 +358,9 @@ var AISprite = function(game, x, y, spritetype) { 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); - var GOFUCKYERSELF = function() { - this.clear_bubble = true; - console.log("GOFUCKYERSELF fired"); - } - - setTimeout(GOFUCKYERSELF, 5000); + timer = new Phaser.Timer(game); + timerev = timer.add(5000, this.GOFUCKYERSELF, this); + timer.start() } this.update = function()