Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
FogNetwork
GitHub Repository: FogNetwork/Tsunami
Path: blob/main/public/games/files/space-invaders/assets/javascript/state/End.js
1520 views
1
/**
2
* Created by stryker on 2014.03.22..
3
*/
4
define(['module/HUD'],function(HUD){
5
var _game = null,
6
_nextState = null;
7
8
var _End = {
9
create: function(){
10
HUD.createTitle(' Game Over \n Press Spacebar');
11
12
//Starting the Play state after the spacebar is down
13
_game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR).onDown.addOnce(function(){
14
_game.state.start(_nextState);
15
});
16
}
17
}
18
19
return{
20
init: function(game,nextState){
21
_game = game;
22
_nextState = nextState;
23
},
24
getEndState: function(){
25
return (_End);
26
}
27
}
28
})
29