diff --git a/src/core/src/com/ru/tgra/ourcraft/OurCraftGame.java b/src/core/src/com/ru/tgra/ourcraft/OurCraftGame.java index 9b2e09d..6f23afa 100644 --- a/src/core/src/com/ru/tgra/ourcraft/OurCraftGame.java +++ b/src/core/src/com/ru/tgra/ourcraft/OurCraftGame.java @@ -39,13 +39,18 @@ public void create () private void mainMenuInput() { - if(Gdx.input.isKeyPressed(Input.Keys.ENTER) && GameManager.loaded) + if((Gdx.input.isKeyPressed(Input.Keys.ENTER) || Gdx.input.isKeyPressed(Input.Keys.SPACE) ) && GameManager.loaded) { - GameManager.mainMenu = false; - GameManager.createWorld(); + startGame(); } } + private void startGame() + { + GameManager.mainMenu = false; + GameManager.createWorld(); + } + private void mainMenuCreateWorld() { switch (step) @@ -465,7 +470,6 @@ private void drawMainMenu() @Override public void render () { - System.out.print("\r \r"); input(); update(); display(); @@ -546,17 +550,26 @@ private void initInput() @Override public boolean touchDown(int x, int y, int pointer, int button) { - if (button == Input.Buttons.LEFT) + if (GameManager.mainMenu) + { + if (GameManager.loaded) + { + startGame(); + return true; + } + } + else if (button == Input.Buttons.LEFT) { if (GameManager.player.getTargetBlock() != null) { GameManager.player.getTargetBlock().destroy(); + return true; } } - - if (button == Input.Buttons.RIGHT) + else if (button == Input.Buttons.RIGHT) { GameManager.player.placeBlock(); + return true; } return false; @@ -564,6 +577,11 @@ public boolean touchDown(int x, int y, int pointer, int button) @Override public boolean scrolled(int amount) { + if (GameManager.mainMenu) + { + return false; + } + if (amount == -1) { GameManager.player.scrollDownSelectedBlock();