From: fred-boy Date: Fri, 6 Apr 2018 15:42:59 +0000 (+0700) Subject: Rename BlocksLoader to Items X-Git-Tag: alpha0.1~21 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=226f349b0fcb10ca5b7d540ae632c8b7a6600439;p=cavedroid.git Rename BlocksLoader to Items --- diff --git a/core/src/ru/deadsoftware/cavecraft/GameScreen.java b/core/src/ru/deadsoftware/cavecraft/GameScreen.java index efdce04..30382a8 100644 --- a/core/src/ru/deadsoftware/cavecraft/GameScreen.java +++ b/core/src/ru/deadsoftware/cavecraft/GameScreen.java @@ -5,7 +5,6 @@ import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.Screen; import ru.deadsoftware.cavecraft.game.GameInputHandler; import ru.deadsoftware.cavecraft.game.GameProc; -import ru.deadsoftware.cavecraft.game.GameRenderer; public class GameScreen implements Screen { @@ -14,7 +13,7 @@ public class GameScreen implements Screen { public GameScreen() { Assets.load(); - BlocksLoader.load(); + Items.load(); gameProc = new GameProc(); gameInput = new GameInputHandler(gameProc); Gdx.input.setInputProcessor(new InputHandler()); diff --git a/core/src/ru/deadsoftware/cavecraft/BlocksLoader.java b/core/src/ru/deadsoftware/cavecraft/Items.java similarity index 94% rename from core/src/ru/deadsoftware/cavecraft/BlocksLoader.java rename to core/src/ru/deadsoftware/cavecraft/Items.java index 0d453c9..2a4071f 100644 --- a/core/src/ru/deadsoftware/cavecraft/BlocksLoader.java +++ b/core/src/ru/deadsoftware/cavecraft/Items.java @@ -3,7 +3,7 @@ package ru.deadsoftware.cavecraft; import com.badlogic.gdx.utils.ArrayMap; import ru.deadsoftware.cavecraft.game.objects.Block; -public class BlocksLoader { +public class Items { public static ArrayMap BLOCKS = new ArrayMap(); diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java index 54ec384..42bd07e 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java @@ -6,10 +6,9 @@ import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector3; import ru.deadsoftware.cavecraft.Assets; -import ru.deadsoftware.cavecraft.BlocksLoader; +import ru.deadsoftware.cavecraft.Items; import ru.deadsoftware.cavecraft.GameScreen; import ru.deadsoftware.cavecraft.game.objects.Player; @@ -65,11 +64,11 @@ public class GameRenderer { for (int x=minX; x0) { spriteBatch.draw( - BlocksLoader.BLOCKS.getValueAt(gameProc.world.getForeMap(x,y)).getTexture(), + Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x,y)).getTexture(), x * 16 - camera.position.x,y * 16 - camera.position.y); } else if (gameProc.world.getBackMap(x,y)>0) { spriteBatch.draw( - BlocksLoader.BLOCKS.getValueAt(gameProc.world.getBackMap(x,y)).getTexture(), + Items.BLOCKS.getValueAt(gameProc.world.getBackMap(x,y)).getTexture(), x * 16 - camera.position.x,y * 16 - camera.position.y); Assets.shade.setPosition(x * 16 - camera.position.x,y * 16 - camera.position.y); Assets.shade.draw(spriteBatch); @@ -89,7 +88,7 @@ public class GameRenderer { camera.viewportHeight - Assets.invBar.getRegionHeight()); for (int i=0; i<8; i++) { if (gameProc.player.inventory[i]>0) { - spriteBatch.draw(BlocksLoader.BLOCKS.getValueAt(gameProc.player.inventory[i]).getTexture(), + spriteBatch.draw(Items.BLOCKS.getValueAt(gameProc.player.inventory[i]).getTexture(), camera.viewportWidth/2 - Assets.invBar.getRegionWidth()/2+3+i*20, camera.viewportHeight-19); }