From f4758c3bac5782dca4ef298f8d1346a649779aea Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sat, 14 Jun 2014 16:33:33 -0700 Subject: [PATCH] Making AI able to 'see' the player --- moonlight/js/moonlight-skulk.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index dcdeb11..23eb517 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -64,8 +64,8 @@ Light.prototype.constructor = Light; Light.prototype.update_new_values = function() { this.radius = parseInt(this.radius); this.fade = this.radius * Number(this.fade); - this.flicker = Boolean(this.flicker); - this.always_render = Boolean(this.always_render) + this.flicker = (this.flicker == 'true'); + this.always_render = (this.always_render == 'true') this.rect = new Phaser.Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2) } @@ -102,9 +102,9 @@ SoundSprite.prototype.update_new_values = function() { } this.sound_position = parseInt(this.sound_position); this.sound_volume = Number(this.sound_volume); - this.sound_loop = Boolean(this.sound_loop); - this.sound_forcerestart = Boolean(this.sound_forcerestart); - this.sound_nofade = Boolean(this.sound_nofade); + this.sound_loop = (this.sound_loop == 'true'); + this.sound_forcerestart = (this.sound_forcerestart == 'true'); + this.sound_nofade = (this.sound_nofade == 'true'); this.sound = game.add.audio(this.sound_key); this.sound.play( @@ -754,10 +754,10 @@ var AISprite = function(game, x, y, key, frame) { this.animations.destroy(); this.clearWordBubble(); this.state = STATE_UNAWARE; - this.can_move = Boolean(this.can_move); - this.collide_with_player = Boolean(this.collide_with_player); - this.collide_with_map = Boolean(this.collide_with_map); - this.carries_light = Boolean(this.carries_light); + this.can_move = (this.can_move == 'true'); + this.collide_with_player = (this.collide_with_player == 'true'); + this.collide_with_map = (this.collide_with_map == 'true'); + this.carries_light = (this.carries_light == 'true'); this.loadTexture(this.sprite_name, 0); addAnimation(this, 'bipedwalkleft');