+ helptext.kill();
+ if (shrinklevel == WIN_CONDITION) {
+ wintext = game.add.text(0, 0, "YOU WON!\nFinally you are free...", { align: 'center', fill: '#ff00ff', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ wintext.x = (game.world.width - wintext.width) / 2;
+ wintext.y = (game.world.height - wintext.height) / 2;
+ walls.children.forEach(function(wall) { wall.body.immovable = false; });
+ var i = 0;
+ gems.children.forEach(function(gem) {
+ switch(i % 4) {
+ case 0: gem.body.gravity.y = 100; break;
+ case 1: gem.body.gravity.x = 100; break;
+ case 2: gem.body.gravity.y = -100; break;
+ case 3: gem.body.gravity.x = -100; break;
+ }
+ i++
+ });
+ }
+ else if (shrinklevel > WIN_CONDITION) {
+ // Kill everything.
+ walls.removeAll(true);
+ gems.removeAll(true);
+ wintext.kill();
+ game.world.setBounds(0, 0, 800 * 3, 600 * 3);
+ player.x = (800 * 3) / 2;
+ player.y = (600 * 3) / 2;
+
+ var endtext;
+ endtext = game.add.text(0, 0, "What are you looking for?", { align: 'center', fill: '#ff00ff', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ endtext.x = (800 - endtext.width) / 2;
+ endtext.y = (600 - endtext.height) / 2;
+
+ endtext = game.add.text(0, 0, "YOU DESTROYED\nTHE WORLD!", { align: 'center', fill: '#ff0000', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ endtext.x = 800 + (800 - endtext.width) / 2;
+ endtext.y = (600 - endtext.height) / 2;
+
+ endtext = game.add.text(0, 0, "This is cool if you\nthink about it...", { align: 'center', fill: '#00ffff', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ endtext.x = (800 * 2) + (800 - endtext.width) / 2;
+ endtext.y = (600 - endtext.height) / 2;
+
+ endtext = game.add.text(0, 0, "You just needed\n\n\n\nsome space.", { align: 'center', fill: '#ff69b4', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ endtext.x = (800 - endtext.width) / 2;
+ endtext.y = 600 + (600 - endtext.height) / 2;
+
+ endtext = game.add.text(0, 0, "Bonanza Banzai", { align: 'center', fill: '#00ff00', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ endtext.x = (800 * 2) + (800 - endtext.width) / 2;
+ endtext.y = 600 + (600 - endtext.height) / 2;
+
+ endtext = game.add.text(0, 0, "But nobody came.", { align: 'center', fill: '#ff0000', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ endtext.x = (800 - endtext.width) / 2;
+ endtext.y = (600 * 2) + (600 - endtext.height) / 2;
+
+ endtext = game.add.text(0, 0, "What do you expect?\nPretty stars?\nOr planets?", { align: 'center', fill: '#00ffff', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ endtext.x = 800 + (800 - endtext.width) / 2;
+ endtext.y = (600 * 2) + (600 - endtext.height) / 2;
+
+ endtext = game.add.text(0, 0, "I think you should abandon this game.\nThere's nothing here.", { align: 'center', fill: '#ff00ff', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' });
+ endtext.x = (800 * 2) + (800 - endtext.width) / 2;
+ endtext.y = (600 * 2) + (600 - endtext.height) / 2;
+ }