1 package ru
.deadsoftware
.cavedroid
;
3 import com
.badlogic
.gdx
.Gdx
;
4 import com
.badlogic
.gdx
.Screen
;
5 import ru
.deadsoftware
.cavedroid
.game
.GameItems
;
6 import ru
.deadsoftware
.cavedroid
.game
.GameProc
;
7 import ru
.deadsoftware
.cavedroid
.game
.GameSaver
;
8 import ru
.deadsoftware
.cavedroid
.menu
.MenuRenderer
;
9 import ru
.deadsoftware
.cavedroid
.misc
.*;
11 public class GameScreen
implements Screen
{
13 public static int FPS
;
14 public static boolean SHOW_DEBUG
= true;
15 public static boolean SHOW_MAP
= false;
16 public static int NEW_GAME_MODE
= 0;
18 public static GameProc GP
;
20 private Renderer renderer
;
21 private MenuRenderer menuRenderer
;
26 menuRenderer
= new MenuRenderer(CaveGame
.TOUCH ?
320 : 480);
27 renderer
= menuRenderer
;
28 Gdx
.input
.setInputProcessor(new InputHandlerMenu(menuRenderer
));
31 public static float getWidth() {
32 return Gdx
.graphics
.getWidth();
35 public static float getHeight() {
36 return Gdx
.graphics
.getHeight();
39 private void game(float delta
) {
51 public void render(float delta
) {
52 FPS
= (int) (1 / delta
);
53 switch (CaveGame
.STATE
) {
55 case GAME_CREATIVE_INV
:
65 GP
.initGame(NEW_GAME_MODE
);
66 renderer
= GP
.renderer
;
67 Gdx
.input
.setInputProcessor(new InputHandlerGame());
68 CaveGame
.STATE
= AppState
.GAME_PLAY
;
72 GP
= GameSaver
.load();
73 renderer
= GP
.renderer
;
74 Gdx
.input
.setInputProcessor(new InputHandlerGame());
75 CaveGame
.STATE
= AppState
.GAME_PLAY
;
80 CaveGame
.STATE
= AppState
.MENU_MAIN
;
85 menuRenderer
= new MenuRenderer(CaveGame
.TOUCH ?
320 : 480);
86 renderer
= menuRenderer
;
87 Gdx
.input
.setInputProcessor(new InputHandlerMenu(menuRenderer
));
94 public void resize(int width
, int height
) {
95 switch (CaveGame
.STATE
) {
97 menuRenderer
= new MenuRenderer(CaveGame
.TOUCH ?
320 : 480);
98 Gdx
.input
.setInputProcessor(new InputHandlerMenu(menuRenderer
));
99 renderer
= menuRenderer
;
102 case GAME_CREATIVE_INV
:
104 renderer
= GP
.renderer
;
110 public void pause() {
115 public void resume() {
125 public void dispose() {