Close #58 , In Progress #57: Start screen exists but credits button doesn't do anything yet. Started Game Over screen but it doesn't show yet (needs #11 and #57)

This commit is contained in:
2014-07-12 22:02:30 -07:00
parent 152414550c
commit 6d5c49a370
5 changed files with 58 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -466,11 +466,6 @@ GameState.prototype.update = function()
this.scoreText.setText("" + player.score);
}
function Boot()
{
Phaser.State.call(game, this);
}
var Boot = function(game) {
}
@@ -525,11 +520,52 @@ Preloader.prototype.create = function()
{
function goalready() {
this.preloadBar.destroy();
game.state.start('game', true, false);
game.state.start('startscreen', true, false);
}
var tween = this.add.tween(this.preloadBar).to({ alpha: 0 }, 1000, Phaser.Easing.Linear.None, true);
tween.onComplete.add(goalready, this);
}
var StartScreen = function(game) {
}
StartScreen.prototype.create = function()
{
this.startGameButton = game.add.button((640 / 2) - (224/2),
100,
'newgamebtn',
this.startGameClicked,
this,
1,
0);
this.creditsButton = game.add.button((640 / 2) - (182/2),
200,
'creditsbtn',
this.creditsClicked,
this,
1,
0);
}
StartScreen.prototype.startGameClicked = function()
{
this.startGameButton.destroy();
this.creditsButton.destroy();
game.state.start('game', true, false);
}
StartScreen.prototype.creditsClicked = function()
{
console.log("Roll the credits dumbass");
}
var EndScreen = function(game) {
}
EndScreen.prototype.create = function()
{
this.scoreText = this.game.add.text(
320, 240, 'GAME OVER',
{ font: '32px Arial', fill: '#ffffff' });
}

View File

@@ -165,6 +165,20 @@ var moonlightSettings = {
}
],
'spritesheets': [
{
'name': 'newgamebtn',
'path': 'gfx/ui/newgamebtn.png',
'width': 224,
'height': 64,
'frames': 2
},
{
'name': 'creditsbtn',
'path': 'gfx/ui/creditsbtn.png',
'width': 182,
'height': 64,
'frames': 2
},
{
'name': 'clock_minutehand',
'path': 'gfx/ui/clock_minutehand.png',

View File

@@ -7,10 +7,8 @@ var game = new Phaser.Game(SCREEN_WIDTH, SCREEN_HEIGHT, Phaser.AUTO, 'uiGameDisp
game.state.add('boot', Boot, false);
game.state.add('preloader', Preloader, false);
game.state.add('game', GameState, false);
game.state.add('startscreen', StartScreen, false);
game.state.add('endscreen', EndScreen, false);
game.state.start('boot');