Path: blob/main/public/games/files/space-invaders/assets/javascript/state/Start.js
1520 views
/**1* Created by stryker on 2014.03.22..2*/3define(['module/HUD'],function(HUD){4var _game = null,5_nextState = null,6_activationKey = null;78//Start State9var _Start = {10create: function(){11//creating the titel screen12HUD.createTitle(' Space Invader \n Press Spacebar');1314//Seeting up the Physics for the game15_game.physics.startSystem(Phaser.Physics.ARCADE);1617//Starting the next state(Play) after the spacebar is down18_game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR).onDown.addOnce(function(){19_game.state.start(_nextState);20});21}22}2324return{25init: function(game,nextState){26_game = game;27_nextState = nextState;28},29getStartState: function(){30return(_Start);31}3233}34})3536