Skip to content

Commit

Permalink
Removing unused game objects for perf
Browse files Browse the repository at this point in the history
  • Loading branch information
swndr committed Apr 13, 2015
1 parent 8221930 commit 69db111
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,10 @@ function generateConditions(set,p) {
createjs.Tween.get(winOverlay, {override:true}).to({y:canvas.height}, 300, createjs.Ease.cubicInOut).call(rmAnim);
}

for (i in objectsInPlay) {
objectsInPlay[i] = null;
}

objectsInPlay = [];

for (var i = 0; i < 10; i++) {
Expand Down Expand Up @@ -2058,6 +2062,10 @@ function generateConditions(set,p) {
rmAnim();
startOverlay.uncache();

for (i in objectsInPlay) {
objectsInPlay[i] = null;
}

objectsInPlay = [];
newGameLabel.alpha = 0;
exitLabel.alpha = 0;
Expand Down

0 comments on commit 69db111

Please sign in to comment.