Browse code

allow to go to title from game over screen

devnewton authored on 04/11/2016 17:35:12
Showing 1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 /// <reference path="../../typings/phaser.d.ts"/>
2 2
 import { AbstractState } from "./AbstractState.ts"; // you import only AClass
3
+import {MenuButton} from "../ui/MenuButton.ts";
3 4
 
4 5
 export class GameOver extends AbstractState {
5 6
 
... ...
@@ -14,5 +15,6 @@ export class GameOver extends AbstractState {
14 15
     create() {
15 16
         super.create();
16 17
         this.game.add.image(0, 0, 'gameover');
18
+        new MenuButton(this.game, "Main menu", 500, 900, () => this.game.state.start('Title'));
17 19
     }
18 20
 }