DEADSOFTWARE

2ebe4271428c060b173552777d4366fe384c66b9
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / menu / submenus / MenuInput.java
1 package ru.deadsoftware.cavedroid.menu.submenus;
3 import com.badlogic.gdx.Gdx;
4 import ru.deadsoftware.cavedroid.CaveGame;
5 import ru.deadsoftware.cavedroid.game.GameProc;
6 import ru.deadsoftware.cavedroid.game.GameSaver;
7 import ru.deadsoftware.cavedroid.misc.states.AppState;
8 import ru.deadsoftware.cavedroid.misc.states.MenuState;
10 import static ru.deadsoftware.cavedroid.GameScreen.GP;
12 class MenuInput {
14 private static void startNewGame(int gameMode) {
15 GP = new GameProc(gameMode);
16 GP.player.respawn();
17 GameSaver.save(GP);
18 CaveGame.APP_STATE = AppState.LOAD;
19 }
21 static void newGameClicked() {
22 CaveGame.MENU_STATE = MenuState.NEW_GAME;
23 }
25 static void loadGameClicked() {
26 CaveGame.APP_STATE = AppState.LOAD;
27 GP = GameSaver.load();
28 }
30 static void quitClicked() {
31 Gdx.app.exit();
32 }
34 static void survivalClicked() {
35 startNewGame(0);
36 }
38 static void creativeClicked() {
39 startNewGame(1);
40 }
42 static void backClicked() {
43 CaveGame.MENU_STATE = MenuState.MAIN;
44 }
46 }