master
GammelJAN 6 years ago
parent 880414cf22
commit 96487c77f2

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 35 KiB

@ -29,6 +29,9 @@ public abstract class Item {
public int getHeal(){
return heal;
}
public int getLvl(){
return lvl;
}
/**
* @return the amount
*/

@ -80,9 +80,9 @@ public class GameScreen {
//PLAYER
Texture[] playerTexture = new Texture[4];
playerTexture[0] = new Texture(Gdx.files.internal("sprites/player.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/body.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/head.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/hair.png"));
playerTexture[1] = new Texture(Gdx.files.internal("sprites/player.png"));
playerTexture[2] = new Texture(Gdx.files.internal("sprites/player.png"));
playerTexture[3] = new Texture(Gdx.files.internal("sprites/player.png"));
player = new PlayerSprite(playerTexture);

@ -6,6 +6,7 @@
package com.dungeoncrawler.view;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
@ -32,9 +33,15 @@ public class HudContainer {
float playerHealthX;
float playerHealthY;
BitmapFont font;
float HudPosX;
float HudPosY;
public HudContainer(){
font = new BitmapFont();
font.setColor(1, 1, 1, 1);
selectedTexture = new Texture("sprites/selected.png");
selectedSprite = new Sprite(selectedTexture);
HudTexture = new Texture("sprites/hud.png");
@ -46,32 +53,38 @@ public class HudContainer {
invXPos = new float[8];
invYPos = new float[8];
playerHealthTexture = new Texture("sprites/playerHealthBar.png");
playerHealthSprite = new Sprite();
playerHealthX = HudSprite.getX()+36f;
playerHealthY = HudSprite.getY()+260f;
HudPosX = HudSprite.getX();
HudPosY = HudSprite.getY();
playerHealthX = HudPosX+36f;
playerHealthY = HudPosY+260f;
//Equipped 1
invXPos[0] = HudSprite.getX() + 37f;
invYPos[0] = HudSprite.getY() + 112f;
invXPos[0] = HudPosX + 37f;
invYPos[0] = HudPosY + 112f;
//Equipped 2
invXPos[1] = HudSprite.getX() + 85f;
invYPos[1] = HudSprite.getY() + 112f;
invXPos[1] = HudPosX + 85f;
invYPos[1] = HudPosY + 112f;
invXPos[2] = HudSprite.getX() + 10f;
invYPos[2] = HudSprite.getY() + 61f;
invXPos[3] = HudSprite.getX() + 61f;
invYPos[3] = HudSprite.getY() + 61f;
invXPos[4] = HudSprite.getX() + 112f;
invYPos[4] = HudSprite.getY() + 61f;
invXPos[2] = HudPosX + 10f;
invYPos[2] = HudPosY + 61f;
invXPos[3] = HudPosX + 61f;
invYPos[3] = HudPosY + 61f;
invXPos[4] = HudPosX + 112f;
invYPos[4] = HudPosY + 61f;
invXPos[5] = HudSprite.getX() + 10f;
invYPos[5] = HudSprite.getY() + 10f;
invXPos[6] = HudSprite.getX() + 61f;
invYPos[6] = HudSprite.getY() + 10f;
invXPos[7] = HudSprite.getX() + 112f;
invYPos[7] = HudSprite.getY() + 10f;
invXPos[5] = HudPosX + 10f;
invYPos[5] = HudPosY + 10f;
invXPos[6] = HudPosX + 61f;
invYPos[6] = HudPosY + 10f;
invXPos[7] = HudPosX + 112f;
invYPos[7] = HudPosY + 10f;
selected = 2;
selectedSprite.setX(invXPos[selected] - 2f);
@ -82,7 +95,7 @@ public class HudContainer {
}
public void updateHud(SpriteBatch batch, Player p){
InventoryItemSprites = new Sprite[8];
InventoryItemSprites = new Sprite[8];
Item[] items = p.getInv().getItem();
@ -109,6 +122,34 @@ public class HudContainer {
}
selectedSprite.draw(batch);
playerHealthSprite.draw(batch);
if(items[selected] != null){
String selectedName = "";
int selectedPerkValue = 0;
String perk = "";
String lvl = "Lvl: "+ items[selected].getLvl();
switch(items[selected].getId()){
case 0:
selectedName = "key ";
break;
case 1:
selectedName = "Potion ";
perk = "Heal: ";
selectedPerkValue = items[selected].getHeal();
break;
case 2:
selectedName = "Amulet ";
perk = "Damage: ";
selectedPerkValue = items[selected].getDmg();
}
font.draw(batch, selectedName + lvl, HudPosX + 40, HudPosY + 210);
font.draw(batch, perk + selectedPerkValue, HudPosX + 40, HudPosY + 190);
}
batch.end();
@ -129,7 +170,7 @@ public class HudContainer {
case 1:
if(InventoryItemSprites[x] == null){
//InventoryItemTextures[i] = new Texture("sprites/itemTest.png");
InventoryItemTextures[x] = new Texture("sprites/healingPotion.png");
InventoryItemTextures[x] = new Texture("sprites/potion.png");
InventoryItemSprites[x] = new Sprite(InventoryItemTextures[x]);
InventoryItemSprites[x].setX(invXPos[x]);
InventoryItemSprites[x].setY(invYPos[x]);
@ -139,7 +180,7 @@ public class HudContainer {
case 2:
if(InventoryItemSprites[x] == null){
//InventoryItemTextures[i] = new Texture("sprites/itemTest.png");
InventoryItemTextures[x]= new Texture("sprites/sword.png");
InventoryItemTextures[x]= new Texture("sprites/amulet.png");
InventoryItemSprites[x] = new Sprite(InventoryItemTextures[x]);
InventoryItemSprites[x].setX(invXPos[x]);
InventoryItemSprites[x].setY(invYPos[x]);

@ -6,6 +6,7 @@ import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
@ -35,6 +36,7 @@ public class MainMenu{
public Music music;
public MainMenu(float volume) {
//MENU-SCREEN
w = Gdx.graphics.getWidth();
h = Gdx.graphics.getHeight();

@ -36,7 +36,7 @@ public class MapGenerator {
allTiles[i] = TextureRegion.split(tiles[i], 48, 48);
}
torchT = new Texture("sprites/torch.png");
sword = new Texture("sprites/sword.png");
sword = new Texture("sprites/amulet.png");
}
public Map generateMap(Dungeon d){

Loading…
Cancel
Save