e3278d1bf4c92eb973439dafe1178e9f2a3e8107
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
.MenuProc
;
9 import ru
.deadsoftware
.cavedroid
.misc
.Assets
;
10 import ru
.deadsoftware
.cavedroid
.misc
.InputHandlerGame
;
11 import ru
.deadsoftware
.cavedroid
.misc
.Renderer
;
12 import ru
.deadsoftware
.cavedroid
.misc
.states
.AppState
;
13 import ru
.deadsoftware
.cavedroid
.misc
.states
.GameState
;
14 import ru
.deadsoftware
.cavedroid
.misc
.states
.MenuState
;
16 import javax
.annotation
.Nullable
;
18 public class GameScreen
implements Screen
{
20 public static GameProc GP
;
22 public static int FPS
;
23 public static boolean SHOW_DEBUG
= false;
24 public static boolean SHOW_MAP
= false;
26 private Renderer renderer
;
27 private MenuProc menuProc
;
29 @Nullable private InputHandlerGame inputHandlerGame
;
34 menuProc
= new MenuProc(CaveGame
.TOUCH ?
320 : 480);
36 Gdx
.input
.setInputProcessor(menuProc
);
39 public static float getWidth() {
40 return Gdx
.graphics
.getWidth();
43 public static float getHeight() {
44 return Gdx
.graphics
.getHeight();
59 public void render(float delta
) {
60 FPS
= (int) (1 / delta
);
61 switch (CaveGame
.APP_STATE
) {
71 renderer
= GP
.resetRenderer();
72 if (inputHandlerGame
== null) {
73 inputHandlerGame
= new InputHandlerGame();
75 Gdx
.input
.setInputProcessor(inputHandlerGame
);
76 CaveGame
.APP_STATE
= AppState
.GAME
;
77 CaveGame
.GAME_STATE
= GameState
.PLAY
;
82 CaveGame
.APP_STATE
= AppState
.MENU
;
83 CaveGame
.MENU_STATE
= MenuState
.MAIN
;
86 Gdx
.input
.setInputProcessor(menuProc
);
93 public void resize(int width
, int height
) {
94 switch (CaveGame
.APP_STATE
) {
96 menuProc
= new MenuProc(CaveGame
.TOUCH ?
320 : 480);
97 Gdx
.input
.setInputProcessor(menuProc
);
101 renderer
= GP
.resetRenderer();
107 public void pause() {
112 public void resume() {
122 public void dispose() {