DEADSOFTWARE

Fix code style
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / GameRenderer.java
index 7eed8a7d85884890c8cbc87eb8b11ebd90646707..5a8ab943a1b5c18691497a2f6523f1e9d47d45b7 100644 (file)
 package ru.deadsoftware.cavecraft.game;
 
 import com.badlogic.gdx.Gdx;
-import com.badlogic.gdx.graphics.Color;
 import com.badlogic.gdx.graphics.GL20;
-import com.badlogic.gdx.graphics.OrthographicCamera;
-import com.badlogic.gdx.graphics.g2d.SpriteBatch;
-import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
 import com.badlogic.gdx.math.MathUtils;
 import com.badlogic.gdx.math.Vector2;
-import ru.deadsoftware.cavecraft.Assets;
 import ru.deadsoftware.cavecraft.CaveGame;
-import ru.deadsoftware.cavecraft.Items;
 import ru.deadsoftware.cavecraft.GameScreen;
 import ru.deadsoftware.cavecraft.game.mobs.Mob;
+import ru.deadsoftware.cavecraft.game.objects.Drop;
 import ru.deadsoftware.cavecraft.game.objects.Player;
+import ru.deadsoftware.cavecraft.misc.Assets;
+import ru.deadsoftware.cavecraft.misc.Renderer;
 
-public class GameRenderer {
+public class GameRenderer extends Renderer {
 
     private GameProc gameProc;
 
-    public OrthographicCamera camera, fontCam;
-    ShapeRenderer shapeRenderer;
-    SpriteBatch spriteBatch, fontBatch;
-
-    public GameRenderer(GameProc gameProc) {
-        Gdx.gl.glClearColor(0f,.6f,.6f,1f);
+    public GameRenderer(GameProc gameProc, float width, float heigth) {
+        super(width, heigth);
+        Gdx.gl.glClearColor(0f, .6f, .6f, 1f);
         this.gameProc = gameProc;
-        camera = new OrthographicCamera();
-        if (!CaveGame.TOUCH) {
-            camera.setToOrtho(true, 480,
-                    480 * ((float) GameScreen.getHeight() / GameScreen.getWidth()));
-        } else {
-            camera.setToOrtho(true, 320,
-                    320 * ((float) GameScreen.getHeight() / GameScreen.getWidth()));
-        }
-        shapeRenderer = new ShapeRenderer();
-        shapeRenderer.setProjectionMatrix(camera.combined);
-        shapeRenderer.setAutoShapeType(true);
-        spriteBatch = new SpriteBatch();
-        spriteBatch.setProjectionMatrix(camera.combined);
-
-        fontCam = new OrthographicCamera();
-        fontCam.setToOrtho(true, GameScreen.getWidth(), GameScreen.getHeight());
-        fontBatch = new SpriteBatch();
-        fontBatch.setProjectionMatrix(fontCam.combined);
-    }
-
-    private void setFontColor(int r, int g, int b) {
-        Assets.minecraftFont.setColor(r/255f, g/255f, b/255f, 1f);
-    }
-
-    private void drawString(String str, float x, float y) {
-        Assets.minecraftFont.draw(fontBatch, str, x, y);
     }
 
-    private void drawWorld() {
-        int minX = (int) (camera.position.x/16);
-        int minY = (int) (camera.position.y/16);
-        int maxX = (int) ((camera.position.x+camera.viewportWidth)/16)+1;
-        int maxY = (int) ((camera.position.y+camera.viewportHeight)/16)+1;
-        if (minX<0) minX=0;
-        if (minY<0) minY=0;
-        if (maxX>gameProc.world.getWidth()) maxX = gameProc.world.getWidth();
-        if (maxY>gameProc.world.getHeight()) maxY = gameProc.world.getHeight();
-        for (int y=minY; y<maxY; y++) {
-            for (int x=minX; x<maxX; x++) {
-                if (gameProc.world.getForeMap(x,y)>0){/* &&
-                        !Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x,y)).foreground) {
+    private void drawWorldBackground() {
+        int minX = (int) (camera.position.x / 16) - 1;
+        int minY = (int) (camera.position.y / 16) - 1;
+        int maxX = (int) ((camera.position.x + camera.viewportWidth) / 16) + 1;
+        int maxY = (int) ((camera.position.y + camera.viewportHeight) / 16) + 1;
+        if (minY < 0) minY = 0;
+        if (maxY > gameProc.world.getHeight()) maxY = gameProc.world.getHeight();
+        for (int y = minY; y < maxY; y++) {
+            for (int x = minX; x < maxX; x++) {
+                if ((gameProc.world.getForeMap(x, y) == 0 || Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x, y)).transparent)
+                        && gameProc.world.getBackMap(x, y) > 0) {
                     spriteBatch.draw(
-                            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(
-                            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.blockTextures[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);
                 }
+                if (gameProc.world.getForeMap(x, y) > 0 && Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x, y)).background) {
+                    spriteBatch.draw(
+                            Assets.blockTextures[Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x, y)).getTexture()],
+                            x * 16 - camera.position.x, y * 16 - camera.position.y);
+                }
             }
         }
     }
 
-    private void drawWorldForeground(){
-        int minX = (int) (camera.position.x/16);
-        int minY = (int) (camera.position.y/16);
-        int maxX = (int) ((camera.position.x+camera.viewportWidth)/16)+1;
-        int maxY = (int) ((camera.position.y+camera.viewportHeight)/16)+1;
-        if (minX<0) minX=0;
-        if (minY<0) minY=0;
-        if (maxX>gameProc.world.getWidth()) maxX = gameProc.world.getWidth();
-        if (maxY>gameProc.world.getHeight()) maxY = gameProc.world.getHeight();
-        for (int y=minY; y<maxY; y++) {
-            for (int x=minX; x<maxX; x++) {
-                if (gameProc.world.getForeMap(x,y)>0) { /*&&
-                        Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x,y)).foreground) {*/
+    private void drawWorldForeground() {
+        int minX = (int) (camera.position.x / 16) - 1;
+        int minY = (int) (camera.position.y / 16) - 1;
+        int maxX = (int) ((camera.position.x + camera.viewportWidth) / 16) + 1;
+        int maxY = (int) ((camera.position.y + camera.viewportHeight) / 16) + 1;
+        if (minY < 0) minY = 0;
+        if (maxY > gameProc.world.getHeight()) maxY = gameProc.world.getHeight();
+        for (int y = minY; y < maxY; y++) {
+            for (int x = minX; x < maxX; x++) {
+                if (gameProc.world.getForeMap(x, y) > 0 && !Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x, y)).background) {
                     spriteBatch.draw(
-                            Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x,y)).getTexture(),
-                            x * 16 - camera.position.x,y * 16 - camera.position.y);
+                            Assets.blockTextures[Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x, y)).getTexture()],
+                            x * 16 - camera.position.x, y * 16 - camera.position.y);
                 }
             }
         }
@@ -104,107 +68,186 @@ public class GameRenderer {
 
     private void drawMob(Mob mob) {
         mob.draw(spriteBatch,
-                mob.position.x-camera.position.x, mob.position.y-camera.position.y);
+                mob.position.x - camera.position.x - gameProc.world.getWidth() * 16, mob.position.y - camera.position.y);
+        mob.draw(spriteBatch,
+                mob.position.x - camera.position.x, mob.position.y - camera.position.y);
+        mob.draw(spriteBatch,
+                mob.position.x - camera.position.x + gameProc.world.getWidth() * 16, mob.position.y - camera.position.y);
+    }
+
+    private void drawDrop(Drop drop) {
+        switch (Items.ITEMS.get(drop.getId()).getType()) {
+            case 0:
+                Assets.blockTextures[Items.ITEMS.get(drop.getId()).getTexture()].setPosition(drop.position.x - camera.position.x - gameProc.world.getWidth() * 16, drop.position.y - camera.position.y);
+                Assets.blockTextures[Items.ITEMS.get(drop.getId()).getTexture()].draw(spriteBatch);
+                Assets.blockTextures[Items.ITEMS.get(drop.getId()).getTexture()].setPosition(drop.position.x - camera.position.x, drop.position.y - camera.position.y);
+                Assets.blockTextures[Items.ITEMS.get(drop.getId()).getTexture()].draw(spriteBatch);
+                Assets.blockTextures[Items.ITEMS.get(drop.getId()).getTexture()].setPosition(drop.position.x - camera.position.x + gameProc.world.getWidth() * 16, drop.position.y - camera.position.y);
+                Assets.blockTextures[Items.ITEMS.get(drop.getId()).getTexture()].draw(spriteBatch);
+        }
     }
 
     private void drawPlayer(Player pl) {
-        if (!pl.moveX.equals(Vector2.Zero) || Assets.playerSkin[0][2].getRotation()!=0) {
-            Assets.playerSkin[0][2].rotate(Mob.ANIM_SPEED);
-            Assets.playerSkin[1][2].rotate(-Mob.ANIM_SPEED);
-            Assets.playerSkin[0][3].rotate(-Mob.ANIM_SPEED);
-            Assets.playerSkin[1][3].rotate(Mob.ANIM_SPEED);
+        if (!pl.moveX.equals(Vector2.Zero) || Assets.playerSprite[0][2].getRotation() != 0) {
+            Assets.playerSprite[0][2].rotate(Player.ANIM_SPEED);
+            Assets.playerSprite[1][2].rotate(-Player.ANIM_SPEED);
+            Assets.playerSprite[0][3].rotate(-Player.ANIM_SPEED);
+            Assets.playerSprite[1][3].rotate(Player.ANIM_SPEED);
         } else {
-            Assets.playerSkin[0][2].setRotation(0);
-            Assets.playerSkin[1][2].setRotation(0);
-            Assets.playerSkin[0][3].setRotation(0);
-            Assets.playerSkin[1][3].setRotation(0);
+            Assets.playerSprite[0][2].setRotation(0);
+            Assets.playerSprite[1][2].setRotation(0);
+            Assets.playerSprite[0][3].setRotation(0);
+            Assets.playerSprite[1][3].setRotation(0);
         }
-        if (Assets.playerSkin[0][2].getRotation()>=60 || Assets.playerSkin[0][2].getRotation()<=-60)
-            Mob.ANIM_SPEED = -Mob.ANIM_SPEED;
+        if (Assets.playerSprite[0][2].getRotation() >= 60 || Assets.playerSprite[0][2].getRotation() <= -60)
+            Player.ANIM_SPEED = -Player.ANIM_SPEED;
 
         //back hand
-        Assets.playerSkin[1][2].setPosition(
+        Assets.playerSprite[1][2].setPosition(
                 pl.position.x - camera.position.x - 6,
                 pl.position.y - camera.position.y);
-        Assets.playerSkin[1][2].draw(spriteBatch);
+        Assets.playerSprite[1][2].draw(spriteBatch);
         //back leg
-        Assets.playerSkin[1][3].setPosition(
+        Assets.playerSprite[1][3].setPosition(
                 pl.position.x - camera.position.x - 6,
                 pl.position.y - camera.position.y + 10);
-        Assets.playerSkin[1][3].draw(spriteBatch);
+        Assets.playerSprite[1][3].draw(spriteBatch);
         //front leg
-        Assets.playerSkin[0][3].setPosition(
+        Assets.playerSprite[0][3].setPosition(
                 pl.position.x - camera.position.x - 6,
                 pl.position.y - camera.position.y + 10);
-        Assets.playerSkin[0][3].draw(spriteBatch);
+        Assets.playerSprite[0][3].draw(spriteBatch);
         //head
-        spriteBatch.draw(Assets.playerSkin[pl.dir][0],
+        spriteBatch.draw(Assets.playerSprite[pl.dir][0],
                 pl.position.x - camera.position.x - 2,
                 pl.position.y - camera.position.y - 2);
         //body
-        spriteBatch.draw(Assets.playerSkin[pl.dir][1],
+        spriteBatch.draw(Assets.playerSprite[pl.dir][1],
                 pl.position.x - camera.position.x - 2, pl.position.y - camera.position.y + 8);
+        //item in hand
+        if (pl.inventory[gameProc.invSlot] > 0)
+            switch (Items.ITEMS.get(pl.inventory[gameProc.invSlot]).getType()) {
+                case 0:
+                    Assets.blockTextures[Items.ITEMS.get(pl.inventory[gameProc.invSlot]).getTexture()].setPosition(
+                            pl.position.x - camera.position.x - 8 * MathUtils.sin(MathUtils.degRad * Assets.playerSprite[0][2].getRotation()),
+                            pl.position.y - camera.position.y + 6 + 8 * MathUtils.cos(MathUtils.degRad * Assets.playerSprite[0][2].getRotation()));
+                    Assets.blockTextures[Items.ITEMS.get(pl.inventory[gameProc.invSlot]).getTexture()].draw(spriteBatch);
+                    break;
+                default:
+                    Assets.itemTextures[Items.ITEMS.get(pl.inventory[gameProc.invSlot]).getTexture()].flip((pl.dir == 0), false);
+                    Assets.itemTextures[Items.ITEMS.get(pl.inventory[gameProc.invSlot]).getTexture()].setRotation(
+                            -45 + pl.dir * 90 + Assets.playerSprite[0][2].getRotation());
+                    Assets.itemTextures[Items.ITEMS.get(pl.inventory[gameProc.invSlot]).getTexture()].setPosition(
+                            pl.position.x - camera.position.x - 10 + (12 * pl.dir) - 8 * MathUtils.sin(MathUtils.degRad * Assets.playerSprite[0][2].getRotation()),
+                            pl.position.y - camera.position.y + 2 + 8 * MathUtils.cos(MathUtils.degRad * Assets.playerSprite[0][2].getRotation()));
+                    Assets.itemTextures[Items.ITEMS.get(pl.inventory[gameProc.invSlot]).getTexture()].draw(spriteBatch);
+                    Assets.itemTextures[Items.ITEMS.get(pl.inventory[gameProc.invSlot]).getTexture()].flip((pl.dir == 0), false);
+                    break;
+            }
         //front hand
-        Assets.playerSkin[0][2].setPosition(
+        Assets.playerSprite[0][2].setPosition(
                 pl.position.x - camera.position.x - 6,
                 pl.position.y - camera.position.y);
-        Assets.playerSkin[0][2].draw(spriteBatch);
+        Assets.playerSprite[0][2].draw(spriteBatch);
     }
 
     private void drawCreative() {
-        float x = camera.viewportWidth/2-Assets.creativeInv.getRegionWidth()/2;
-        float y = camera.viewportHeight/2-Assets.creativeInv.getRegionHeight()/2;
+        float x = camera.viewportWidth / 2 - Assets.creativeInv.getRegionWidth() / 2;
+        float y = camera.viewportHeight / 2 - Assets.creativeInv.getRegionHeight() / 2;
         spriteBatch.draw(Assets.creativeInv, x, y);
-        spriteBatch.draw(Assets.creativeScroll, x+156, y+18);
-        for (int i=1; i<Items.BLOCKS.size; i++) {
-            spriteBatch.draw(Items.BLOCKS.getValueAt(i).getTexture(),x+8+(i%8)*18,
-                    y+18+(i/8)*18);
+        spriteBatch.draw(Assets.creativeScroll, x + 156,
+                y + 18 + (gameProc.creativeScroll * (72 / gameProc.maxCreativeScroll)));
+        for (int i = gameProc.creativeScroll * 8; i < gameProc.creativeScroll * 8 + 40; i++) {
+            if (i > 0 && i < Items.ITEMS.size())
+                switch (Items.ITEMS.get(i).getType()) {
+                    case 0:
+                        spriteBatch.draw(Assets.blockTextures[Items.ITEMS.get(i).getTexture()],
+                                x + 8 + ((i - gameProc.creativeScroll * 8) % 8) * 18,
+                                y + 18 + ((i - gameProc.creativeScroll * 8) / 8) * 18);
+                        break;
+                    case 1:
+                        spriteBatch.draw(Assets.itemTextures[Items.ITEMS.get(i).getTexture()],
+                                x + 8 + ((i - gameProc.creativeScroll * 8) % 8) * 18,
+                                y + 18 + ((i - gameProc.creativeScroll * 8) / 8) * 18);
+                        break;
+                }
         }
-        for (int i=0; i<9; i++) {
-            if (gameProc.player.inventory[i]>0)
-                spriteBatch.draw(Items.BLOCKS.getValueAt(gameProc.player.inventory[i]).getTexture(),
-                        x+8+i*18, y+Assets.creativeInv.getRegionHeight()-24);
+        for (int i = 0; i < 9; i++) {
+            if (gameProc.player.inventory[i] > 0)
+                switch (Items.ITEMS.get(gameProc.player.inventory[i]).getType()) {
+                    case 0:
+                        spriteBatch.draw(Assets.blockTextures[Items.ITEMS.get(gameProc.player.inventory[i]).getTexture()],
+                                x + 8 + i * 18, y + Assets.creativeInv.getRegionHeight() - 24);
+                        break;
+                    case 1:
+                        spriteBatch.draw(Assets.itemTextures[Items.ITEMS.get(gameProc.player.inventory[i]).getTexture()],
+                                x + 8 + i * 18, y + Assets.creativeInv.getRegionHeight() - 24);
+                        break;
+                }
         }
     }
 
     private void drawGUI() {
-        if (gameProc.world.getForeMap(gameProc.cursorX, gameProc.cursorY)>0 ||
-                gameProc.world.getBackMap(gameProc.cursorX, gameProc.cursorY)>0 ||
-                gameProc.ctrlMode==1)
+        if (gameProc.blockDmg > 0) {
+            spriteBatch.draw(Assets.wreck[
+                            10 * gameProc.blockDmg /
+                                    Items.BLOCKS.getValueAt(gameProc.world.getForeMap(gameProc.cursorX, gameProc.cursorY)).getHp()],
+                    gameProc.cursorX * 16 - camera.position.x,
+                    gameProc.cursorY * 16 - camera.position.y);
+        }
+        if (gameProc.world.getForeMap(gameProc.cursorX, gameProc.cursorY) > 0 ||
+                gameProc.world.getBackMap(gameProc.cursorX, gameProc.cursorY) > 0 ||
+                gameProc.ctrlMode == 1 ||
+                !CaveGame.TOUCH)
             spriteBatch.draw(Assets.guiCur,
-                    gameProc.cursorX*16-camera.position.x,
-                    gameProc.cursorY*16-camera.position.y);
-        spriteBatch.draw(Assets.invBar, camera.viewportWidth/2 - Assets.invBar.getRegionWidth()/2, 0);
-        for (int i=0; i<9; i++) {
-            if (gameProc.player.inventory[i]>0) {
-                spriteBatch.draw(Items.BLOCKS.getValueAt(gameProc.player.inventory[i]).getTexture(),
-                        camera.viewportWidth/2 - Assets.invBar.getRegionWidth()/2+3+i*20,
-                        3);
+                    gameProc.cursorX * 16 - camera.position.x,
+                    gameProc.cursorY * 16 - camera.position.y);
+        spriteBatch.draw(Assets.invBar, camera.viewportWidth / 2 - Assets.invBar.getRegionWidth() / 2, 0);
+        for (int i = 0; i < 9; i++) {
+            if (gameProc.player.inventory[i] > 0) {
+                switch (Items.ITEMS.get(gameProc.player.inventory[i]).getType()) {
+                    case 0:
+                        spriteBatch.draw(Assets.blockTextures[Items.ITEMS.get(gameProc.player.inventory[i]).getTexture()],
+                                camera.viewportWidth / 2 - Assets.invBar.getRegionWidth() / 2 + 3 + i * 20,
+                                3);
+                        break;
+                    case 1:
+                        spriteBatch.draw(Assets.itemTextures[Items.ITEMS.get(gameProc.player.inventory[i]).getTexture()],
+                                camera.viewportWidth / 2 - Assets.invBar.getRegionWidth() / 2 + 3 + i * 20,
+                                3);
+                        break;
+                }
             }
         }
         spriteBatch.draw(Assets.invBarCur,
-                camera.viewportWidth/2 - Assets.invBar.getRegionWidth()/2 - 1 + 20*gameProc.invSlot,
+                camera.viewportWidth / 2 - Assets.invBar.getRegionWidth() / 2 - 1 + 20 * gameProc.invSlot,
                 -1);
     }
 
     private void drawTouchGui() {
-        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);
+        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);
+        if (gameProc.ctrlMode == 1) {
+            Assets.shade.setPosition(83, camera.viewportHeight - 21);
+            Assets.shade.draw(spriteBatch);
+        }
     }
 
     private void drawGamePlay() {
-        drawWorld();
-        for (Mob mob : gameProc.mobs) drawMob(mob);
+        drawWorldBackground();
         drawPlayer(gameProc.player);
+        for (Mob mob : gameProc.mobs) drawMob(mob);
+        for (Drop drop : gameProc.drops) drawDrop(drop);
         drawWorldForeground();
         drawGUI();
     }
 
+    @Override
     public void render() {
         Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
 
@@ -218,28 +261,19 @@ public class GameRenderer {
                 drawCreative();
                 break;
         }
-        spriteBatch.end();
 
-        shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
-        shapeRenderer.setColor(Color.ORANGE);
-        shapeRenderer.line(0-camera.position.x, 128*16-camera.position.y,
-                gameProc.world.getWidth()*16-camera.position.x, 128*16-camera.position.y);
-        shapeRenderer.end();
+        if (CaveGame.TOUCH) drawTouchGui();
 
-        if (CaveGame.TOUCH) {
-            spriteBatch.begin();
-            drawTouchGui();
-            spriteBatch.end();
+        if (GameScreen.SHOW_DEBUG) {
+            drawString("FPS: " + GameScreen.FPS, 0, 0);
+            drawString("X: " + (int) (gameProc.player.position.x / 16), 0, 10);
+            drawString("Y: " + (int) (gameProc.player.position.y / 16), 0, 20);
+            drawString("Mobs: " + gameProc.mobs.size(), 0, 30);
+            drawString("Drops: " + gameProc.drops.size(), 0, 40);
+            drawString("Block: " + Items.BLOCKS.getKeyAt(gameProc.world.getForeMap(gameProc.cursorX, gameProc.cursorY)), 0, 50);
         }
 
-        fontBatch.begin();
-        setFontColor(255,255,255);
-        drawString("CaveCraft "+CaveGame.VERSION, 0, 0);
-        drawString("FPS: "+GameScreen.FPS, 0, 20);
-        drawString("X: "+(int)(gameProc.player.position.x/16), 0, 40);
-        drawString("Y: "+(int)(gameProc.player.position.y/16), 0, 60);
-        drawString("Seed: "+WorldGen.getSeed(), 0, 80);
-        fontBatch.end();
+        spriteBatch.end();
     }
 
 }