From bdc8401b8a37c43e91a7fde1e77ab4784eac1ee4 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 12 Jun 2014 01:57:56 -0700 Subject: [PATCH] Moved to graphical word bubbles --- moonlight/js/moonlight-skulk.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index ff82d42..663b09f 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -575,6 +575,9 @@ var AISprite = function(game, x, y, spritetype) { this.bubble = game.add.sprite(this.x, this.y, myline); game.physics.arcade.enable(this.bubble); + this.bubble.x = this.x - (this.bubble.width / 2); + this.bubble.y = this.y - (this.bubble.height); + timer = game.time.create(false); timerev = timer.add(5000, this.clearWordBubble, this); timer.start() @@ -594,8 +597,8 @@ var AISprite = function(game, x, y, spritetype) { } if ( this.bubble !== null ) { - this.bubble.x = this.x - (this.bubble.width / 2); - this.bubble.y = this.y - (this.bubble.height); + this.bubble.body.velocity.x = this.body.velocity.x; + this.bubble.body.velocity.y = this.body.velocity.y; } switch ( game.rnd.integerInRange(0, 4) ) {