From f7cc93fff73659b11d3666cdfd92efca1bf403dd Mon Sep 17 00:00:00 2001 From: fred-boy Date: Mon, 23 Apr 2018 00:34:28 +0700 Subject: [PATCH] Fix bugs --- core/src/ru/deadsoftware/cavecraft/GameScreen.java | 1 - .../ru/deadsoftware/cavecraft/game/GamePhysics.java | 2 +- core/src/ru/deadsoftware/cavecraft/game/GameProc.java | 4 ++-- core/src/ru/deadsoftware/cavecraft/game/GameWorld.java | 10 +++++++--- .../ru/deadsoftware/cavecraft/menu/MenuRenderer.java | 3 +-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/core/src/ru/deadsoftware/cavecraft/GameScreen.java b/core/src/ru/deadsoftware/cavecraft/GameScreen.java index accd1e5..52c3dcf 100644 --- a/core/src/ru/deadsoftware/cavecraft/GameScreen.java +++ b/core/src/ru/deadsoftware/cavecraft/GameScreen.java @@ -16,7 +16,6 @@ public class GameScreen implements Screen { public GameScreen() { Assets.load(); Items.load(); - gameProc = new GameProc(); menuRenderer = new MenuRenderer(CaveGame.TOUCH?320:480); renderer = menuRenderer; Gdx.input.setInputProcessor(new InputHandlerMenu(menuRenderer)); diff --git a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java index 07587e6..3c2e9ec 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java @@ -97,7 +97,7 @@ public class GamePhysics { if (pl.position.x+pl.texWidth/2<0) pl.position.x+=gameProc.world.getWidth()*16; if (pl.position.x+pl.texWidth/2>gameProc.world.getWidth()*16) pl.position.x-=gameProc.world.getWidth()*16; if (pl.position.y > gameProc.world.getHeight()*16) { - pl.position = gameProc.world.getSpawnPoint().cpy(); + pl.position = gameProc.world.getSpawnPoint(0).cpy(); } if (CaveGame.TOUCH && checkJump(pl.getRect(), pl.dir) && !pl.flyMode && pl.canJump && !pl.moveX.equals(Vector2.Zero)) { pl.moveY.add(0, -8); diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameProc.java b/core/src/ru/deadsoftware/cavecraft/game/GameProc.java index b100ddc..dfe4d6b 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameProc.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameProc.java @@ -40,10 +40,10 @@ public class GameProc { 480*((float)GameScreen.getHeight()/GameScreen.getWidth())); } physics = new GamePhysics(this); - player = new Player(world.getSpawnPoint()); + player = new Player(world.getSpawnPoint(0)); mobs = new Array(); for (int i=0; i0 && Items.BLOCKS.getValueAt(getForeMap(x,y)).collision) break; + } x = x*16 + 4; - y *= 16; + y = y*16 - 32; return new Vector2(x,y); } diff --git a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java index 482db61..c8cbc28 100644 --- a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java @@ -37,8 +37,7 @@ public class MenuRenderer extends Renderer { spriteBatch.begin(); for (int x=0; x<=getWidth()/16; x++) for (int y=0; y<=getHeight()/16; y++) { - if (y == 0) spriteBatch.draw(Items.BLOCKS.get("grass").getTexture(), x * 16, y * 16); - else spriteBatch.draw(Items.BLOCKS.get("dirt").getTexture(), x * 16, y * 16); + spriteBatch.draw(Items.BLOCKS.get("dirt").getTexture(), x * 16, y * 16); spriteBatch.draw(Assets.shade,x*16,y*16); } spriteBatch.draw(Assets.gameLogo, getWidth()/2-Assets.gameLogo.getWidth()/2, 0); -- 2.29.2