summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1034597)
raw | patch | inline | side by side (parent: 1034597)
author | fred-boy <fred-boy@protonmail.com> | |
Thu, 19 Apr 2018 12:33:36 +0000 (19:33 +0700) | ||
committer | fred-boy <fred-boy@protonmail.com> | |
Thu, 19 Apr 2018 12:33:36 +0000 (19:33 +0700) |
diff --git a/build.gradle b/build.gradle
index 268317dc574b21cfcf66c77032bb04920724f8f8..a9fac5c5f7b57ee23fe71bad50c53630502f0604 100644 (file)
--- a/build.gradle
+++ b/build.gradle
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.2.0'
+ classpath 'com.android.tools.build:gradle:2.1.3'
}
tasks.eclipse.doLast {
delete ".project"
-}
\ No newline at end of file
+}
diff --git a/core/src/ru/deadsoftware/cavecraft/InputHandler.java b/core/src/ru/deadsoftware/cavecraft/InputHandler.java
index 4ceb0f87051031621a8c3a7b97f04239a4b8ec24..da3e9e43d9be2deaf71a0454ae92f0a92d288519 100644 (file)
public InputHandler(GameProc gameProc) {
this.gameProc = gameProc;
this.gameInput = new GameInputHandler(gameProc);
- tWidth = gameProc.renderer.touchCam.viewportWidth;
- tHeight = gameProc.renderer.touchCam.viewportHeight;
+ tWidth = gameProc.renderer.camera.viewportWidth;
+ tHeight = gameProc.renderer.camera.viewportHeight;
}
@Override
diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java b/core/src/ru/deadsoftware/cavecraft/game/GameInputHandler.java
index 61b52e41cce84814fe03b5e859707abaacb10f2f..e8c31be65e7c4eb2f2409a1952cf7aa8a87d0d63 100644 (file)
}
} else if (CaveGame.STATE == GameState.GAME_CREATIVE_INV) {
CaveGame.STATE = GameState.GAME_PLAY;
- } else if (button == Input.Buttons.RIGHT &&
- !gameProc.player.canJump && !gameProc.player.flyMode) {
- gameProc.world.placeToForeground(gameProc.cursorX, gameProc.cursorY,
- gameProc.player.inventory[gameProc.invSlot]);
} else {
gameProc.touchDownX = screenX;
gameProc.touchDownY = screenY;
diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java
index f1e830d61586e77267c6ca88b8494f8e84aeff6d..e119487ee12355a107125409e99e15927cf9eea7 100644 (file)
private GameProc gameProc;
- public OrthographicCamera camera, fontCam, touchCam;
+ public OrthographicCamera camera, fontCam;
ShapeRenderer shapeRenderer;
- SpriteBatch spriteBatch, fontBatch, touchBatch;
+ SpriteBatch spriteBatch, fontBatch;
public GameRenderer(GameProc gameProc) {
Gdx.gl.glClearColor(0f,.6f,.6f,1f);
camera.setToOrtho(true, 480,
480 * ((float) GameScreen.getHeight() / GameScreen.getWidth()));
} else {
- camera.setToOrtho(true, 240,
- 240 * ((float) GameScreen.getHeight() / GameScreen.getWidth()));
+ camera.setToOrtho(true, 320,
+ 320 * ((float) GameScreen.getHeight() / GameScreen.getWidth()));
}
shapeRenderer = new ShapeRenderer();
shapeRenderer.setProjectionMatrix(camera.combined);
fontCam.setToOrtho(true, GameScreen.getWidth(), GameScreen.getHeight());
fontBatch = new SpriteBatch();
fontBatch.setProjectionMatrix(fontCam.combined);
- touchCam = new OrthographicCamera();
- touchCam.setToOrtho(true, 240,
- 240*((float)GameScreen.getHeight()/GameScreen.getWidth()));
- touchBatch = new SpriteBatch();
- touchBatch.setProjectionMatrix(touchCam.combined);
}
private void setFontColor(int r, int g, int b) {
}
private void drawTouchGui() {
- touchBatch.draw(Assets.touchArrows[0],26,touchCam.viewportHeight-52);
- touchBatch.draw(Assets.touchArrows[1],0,touchCam.viewportHeight-26);
- touchBatch.draw(Assets.touchArrows[2],26,touchCam.viewportHeight-26);
- touchBatch.draw(Assets.touchArrows[3],52,touchCam.viewportHeight-26);
- touchBatch.draw(Assets.touchLMB, touchCam.viewportWidth-52, touchCam.viewportHeight-26);
- touchBatch.draw(Assets.touchRMB, touchCam.viewportWidth-26, touchCam.viewportHeight-26);
- touchBatch.draw(Assets.touchToggleMode, 78, touchCam.viewportHeight-26);
+ spriteBatch.draw(Assets.touchArrows[0],26,camera.viewportHeight-52);
+ spriteBatch.draw(Assets.touchArrows[1],0,camera.viewportHeight-26);
+ spriteBatch.draw(Assets.touchArrows[2],26,camera.viewportHeight-26);
+ spriteBatch.draw(Assets.touchArrows[3],52,camera.viewportHeight-26);
+ spriteBatch.draw(Assets.touchLMB, camera.viewportWidth-52, camera.viewportHeight-26);
+ spriteBatch.draw(Assets.touchRMB, camera.viewportWidth-26, camera.viewportHeight-26);
+ spriteBatch.draw(Assets.touchToggleMode, 78, camera.viewportHeight-26);
}
private void drawGamePlay() {
spriteBatch.end();
if (CaveGame.TOUCH) {
- touchBatch.begin();
+ spriteBatch.begin();
drawTouchGui();
- touchBatch.end();
+ spriteBatch.end();
}
fontBatch.begin();