1 package ru
.deadsoftware
.cavecraft
;
3 import com
.badlogic
.gdx
.Gdx
;
4 import com
.badlogic
.gdx
.InputProcessor
;
5 import com
.badlogic
.gdx
.Screen
;
6 import ru
.deadsoftware
.cavecraft
.game
.GameInputHandler
;
7 import ru
.deadsoftware
.cavecraft
.game
.GameProc
;
8 import ru
.deadsoftware
.cavecraft
.game
.GameRenderer
;
10 public class GameScreen
implements Screen
{
12 private GameProc gameProc
;
13 private GameInputHandler gameInput
;
16 gameProc
= new GameProc();
17 gameInput
= new GameInputHandler(gameProc
);
19 Gdx
.input
.setInputProcessor(new InputHandler());
22 public static int getWidth() {
23 return Gdx
.graphics
.getWidth();
26 public static int getHeight() {
27 return Gdx
.graphics
.getHeight();
36 public void render(float delta
) {
37 gameProc
.update(delta
);
38 gameProc
.renderer
.render();
42 public void resize(int width
, int height
) {
52 public void resume() {
62 public void dispose() {
66 private class InputHandler
implements InputProcessor
{
69 public boolean keyDown(int keycode
) {
74 public boolean keyUp(int keycode
) {
79 public boolean keyTyped(char character
) {
84 public boolean touchDown(int screenX
, int screenY
, int pointer
, int button
) {
85 gameInput
.touchDown(screenX
, screenY
, button
);
90 public boolean touchUp(int screenX
, int screenY
, int pointer
, int button
) {
91 gameInput
.touchUp(screenX
, screenY
, button
);
96 public boolean touchDragged(int screenX
, int screenY
, int pointer
) {
97 gameInput
.touchDragged(screenX
, screenY
);
102 public boolean mouseMoved(int screenX
, int screenY
) {
103 gameInput
.mouseMoved(screenX
,screenY
);
108 public boolean scrolled(int amount
) {