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:
BIN
moonlight/gfx/ui/creditsbtn.png
Normal file
BIN
moonlight/gfx/ui/creditsbtn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
moonlight/gfx/ui/newgamebtn.png
Normal file
BIN
moonlight/gfx/ui/newgamebtn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -466,11 +466,6 @@ GameState.prototype.update = function()
|
|||||||
this.scoreText.setText("" + player.score);
|
this.scoreText.setText("" + player.score);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Boot()
|
|
||||||
{
|
|
||||||
Phaser.State.call(game, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
var Boot = function(game) {
|
var Boot = function(game) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,11 +520,52 @@ Preloader.prototype.create = function()
|
|||||||
{
|
{
|
||||||
function goalready() {
|
function goalready() {
|
||||||
this.preloadBar.destroy();
|
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);
|
var tween = this.add.tween(this.preloadBar).to({ alpha: 0 }, 1000, Phaser.Easing.Linear.None, true);
|
||||||
tween.onComplete.add(goalready, this);
|
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' });
|
||||||
|
}
|
||||||
|
|||||||
@@ -165,6 +165,20 @@ var moonlightSettings = {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
'spritesheets': [
|
'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',
|
'name': 'clock_minutehand',
|
||||||
'path': 'gfx/ui/clock_minutehand.png',
|
'path': 'gfx/ui/clock_minutehand.png',
|
||||||
|
|||||||
@@ -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('boot', Boot, false);
|
||||||
game.state.add('preloader', Preloader, false);
|
game.state.add('preloader', Preloader, false);
|
||||||
game.state.add('game', GameState, false);
|
game.state.add('game', GameState, false);
|
||||||
|
game.state.add('startscreen', StartScreen, false);
|
||||||
|
game.state.add('endscreen', EndScreen, false);
|
||||||
|
|
||||||
game.state.start('boot');
|
game.state.start('boot');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user