From 050f29169e946d20b2f0965753471b9b83b3a3eb Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Fri, 13 Jun 2014 02:09:01 -0700 Subject: [PATCH] Add wandering sprites back to map via map objects --- moonlight/js/moonlight-skulk.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index d6341e4..39c64c8 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -738,18 +738,10 @@ var AISprite = function(game, x, y, key, frame) { } this.update_new_values = function() { - Phaser.Sprite.call(this, game, x, y, this.sprite_name); + this.loadTexture(this.sprite_name); this.bubble = null; this.clearWordBubble(); this.state = STATE_UNAWARE; - addAnimation(this, 'bipedwalkleft'); - addAnimation(this, 'bipedwalkright'); - addAnimation(this, 'bipedwalkup'); - addAnimation(this, 'bipedwalkdown'); - addAnimation(this, 'bipedrunleft'); - addAnimation(this, 'bipedrunright'); - addAnimation(this, 'bipedrunup'); - addAnimation(this, 'bipedrundown'); } var spritenames_by_type = [ @@ -764,12 +756,20 @@ var AISprite = function(game, x, y, key, frame) { 'townsfolk-guard-1', 'townsfolk-guard-2' ]; - Phaser.Sprite.call(this, game, x, y, null); + Phaser.Sprite.call(this, game, x, y, "townsfolk-male-1"); game.physics.arcade.enable(this); this.body.collideWorldBounds = true; this.sprite_name = "townsfolk-male-1"; this.sprite_group = "townsfolk-male"; + addAnimation(this, 'bipedwalkleft'); + addAnimation(this, 'bipedwalkright'); + addAnimation(this, 'bipedwalkup'); + addAnimation(this, 'bipedwalkdown'); + addAnimation(this, 'bipedrunleft'); + addAnimation(this, 'bipedrunright'); + addAnimation(this, 'bipedrunup'); + addAnimation(this, 'bipedrundown'); this.update_new_values(); }