Close #61 : Schrodinbug... should never have ran at all, things were initializing out of order

This commit is contained in:
2014-07-14 08:44:18 -07:00
parent db6dd115a8
commit ff39bfc9b6

View File

@@ -29,7 +29,10 @@ GameState.prototype.create = function()
); );
if ( lp['inject_sprites'] == true ) { if ( lp['inject_sprites'] == true ) {
this.aiSprites = game.add.group(); this.aiSprites = game.add.group();
this.aiSprites.debug = true; this.aiSprites.debug = false;
this.aiSpriteEffects = game.add.group();
this.staticSounds = game.add.group();
this.bubble_group = game.add.group();
this.map.createFromObjects('AI', 3544, 'player', 0, true, false, this.aiSprites, AISprite); this.map.createFromObjects('AI', 3544, 'player', 0, true, false, this.aiSprites, AISprite);
this.aiSprites.forEach(function(spr) { this.aiSprites.forEach(function(spr) {
spr.update_new_values(); spr.update_new_values();
@@ -111,16 +114,12 @@ GameState.prototype.create = function()
light.update_new_values(); light.update_new_values();
}, this) }, this)
this.aiSpriteEffects = game.add.group();
this.staticSounds = game.add.group();
this.map.createFromObjects('Sounds', 11, 'player', 0, true, false, this.staticSounds, SoundSprite); this.map.createFromObjects('Sounds', 11, 'player', 0, true, false, this.staticSounds, SoundSprite);
this.staticSounds.forEach(function(snd) { this.staticSounds.forEach(function(snd) {
snd.update_new_values(); snd.update_new_values();
}, this) }, this)
this.bubble_group = game.add.group();
this.uigroup = game.add.group(); this.uigroup = game.add.group();
this.recentlyStolenGroup = game.add.group(); this.recentlyStolenGroup = game.add.group();
this.game.time.advancedTiming = true; this.game.time.advancedTiming = true;
@@ -432,7 +431,7 @@ GameState.prototype.update = function()
_AI_collide); _AI_collide);
this.updateShadowTexture(); this.updateShadowTexture();
if ( this.aiSprites.debug == false ) { if ( this.aiSprites.debug == true ) {
function _draw_viewrect(x) { function _draw_viewrect(x) {
var r = x.viewRectangle(); var r = x.viewRectangle();
if ( isSet(r) == false ) if ( isSet(r) == false )
@@ -483,6 +482,8 @@ GameState.prototype.shutdown = function()
}, this); }, this);
this.aiSprites.destroy(); this.aiSprites.destroy();
this.aiSprites = null; this.aiSprites = null;
this.aiSpriteEffects.destroy();
this.aiSpriteEffects = null;
this.uigroup.destroy(); this.uigroup.destroy();
this.uigroup = null; this.uigroup = null;
this.recentlyStolenGroup.destroy(); this.recentlyStolenGroup.destroy();