X-Git-Url: http://git.megabrutal.com/?p=ld38.git;a=blobdiff_plain;f=ld38.js;h=d1a761a2baec4a4b26a97be22ca8dd575224aedf;hp=4179b4a1ad0e801dc2317c2623f6c6f9cddb2bfa;hb=HEAD;hpb=7a4bd52974b755da8ce17b16a2b8fd3d23382f80 diff --git a/ld38.js b/ld38.js index 4179b4a..d1a761a 100644 --- 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; @@ -123,7 +124,6 @@ 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) { @@ -147,6 +147,42 @@ 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; } };