Added game icon
[ld38.git] / ld38.js
diff --git a/ld38.js b/ld38.js
index 4179b4a1ad0e801dc2317c2623f6c6f9cddb2bfa..d1a761a2baec4a4b26a97be22ca8dd575224aedf 100644 (file)
--- a/ld38.js
+++ b/ld38.js
@@ -1,4 +1,5 @@
         var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
+        var player;
         var helptext, wintext;
         var walls;
         var gems;
             var isAllActive = true;
             gems.children.forEach(function(gem) { if (!gem.isActivated) { isAllActive = false; }});
             if (isAllActive && (gems.length > 0)) {
-                console.log(shrinklevel);
                 world_shrink();
                 helptext.kill();
                 if (shrinklevel == WIN_CONDITION) {
                     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;
                 }
             };