summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7115b8c)
raw | patch | inline | side by side (parent: 7115b8c)
author | fred-boy <fred-boy@protonmail.com> | |
Fri, 6 Apr 2018 15:42:59 +0000 (22:42 +0700) | ||
committer | fred-boy <fred-boy@protonmail.com> | |
Fri, 6 Apr 2018 15:42:59 +0000 (22:42 +0700) |
diff --git a/core/src/ru/deadsoftware/cavecraft/GameScreen.java b/core/src/ru/deadsoftware/cavecraft/GameScreen.java
index efdce0440b8bb2a74d179fdd6188ee211ff59671..30382a83cf63183f947658bd251f5fce656fc9a0 100644 (file)
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 {
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 0d453c9883609312becd34256f44785987680e33..2a4071fd8aa29d6681c02f41cfbaaeead1e081d8 100644 (file)
rename from core/src/ru/deadsoftware/cavecraft/BlocksLoader.java
rename to core/src/ru/deadsoftware/cavecraft/Items.java
index 0d453c9883609312becd34256f44785987680e33..2a4071fd8aa29d6681c02f41cfbaaeead1e081d8 100644 (file)
import com.badlogic.gdx.utils.ArrayMap;
import ru.deadsoftware.cavecraft.game.objects.Block;
-public class BlocksLoader {
+public class Items {
public static ArrayMap<String, Block> BLOCKS = new ArrayMap<String, Block>();
diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java
index 54ec384e040cf91cf688cce9b31ba7bcd9ad357f..42bd07e21c7b20004514d3613709134272c6c8a4 100644 (file)
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;
for (int x=minX; x<maxX; x++) {
if (gameProc.world.getForeMap(x,y)>0) {
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);
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);
}