diff --git a/dev/lib/game/main.js b/dev/lib/game/main.js index 3c10730..7d7d625 100755 --- a/dev/lib/game/main.js +++ b/dev/lib/game/main.js @@ -133,11 +133,11 @@ ig.module( } if (ig.input.pressed('submit-score')) { - this.nameField.kill(); - //TODO: The name field does not kill itself ... this.draw(); this.saveScore(this.nameField.name(), ig.global.score, function(context) { setTimeout(function() { context.loadScores(); }, 2000); }); + this.nameField.kill(); + this.nameField = null; } this.parent(); }, @@ -173,7 +173,7 @@ ig.module( } } - this.nameField.draw(260, 200); + if (this.nameField !== null) this.nameField.draw(260, 200); this.font.draw(ig.global.score, 485, 150, ig.Font.ALIGN.RIGHT); } });