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/Start.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
_activationKey = null;
8
9
//Start State
10
var _Start = {
11
create: function(){
12
//creating the titel screen
13
HUD.createTitle(' Space Invader \n Press Spacebar');
14
15
//Seeting up the Physics for the game
16
_game.physics.startSystem(Phaser.Physics.ARCADE);
17
18
//Starting the next state(Play) after the spacebar is down
19
_game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR).onDown.addOnce(function(){
20
_game.state.start(_nextState);
21
});
22
}
23
}
24
25
return{
26
init: function(game,nextState){
27
_game = game;
28
_nextState = nextState;
29
},
30
getStartState: function(){
31
return(_Start);
32
}
33
34
}
35
})
36