Skip to content

Commit 924fc95

Browse files
committed
Added new Window Hud with mana, hp, coins and keys.
1 parent 221c9ee commit 924fc95

30 files changed

Lines changed: 253 additions & 96 deletions

src/main/java/com/khomsi/game/entity/Entity.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import com.khomsi.game.entity.player.Player;
44
import com.khomsi.game.main.GameManager;
55
import com.khomsi.game.main.tools.Tools;
6-
import com.khomsi.game.objects.gui.HeartObject;
7-
import com.khomsi.game.objects.gui.ManaObject;
6+
import com.khomsi.game.objects.spells.HeartObject;
7+
import com.khomsi.game.objects.spells.ManaObject;
88
import com.khomsi.game.objects.interact.CoinBObject;
99

1010
import java.awt.*;
@@ -127,8 +127,6 @@ public class Entity extends Tools{
127127
public Rectangle attackArea = new Rectangle(0, 0, 0, 0);
128128
public int solidAreaDefaultX, solidAreaDefaultY;
129129
public GameManager gameManager;
130-
//FIXME
131-
// public Tools tools = new Tools();
132130
public ProjectTile projectTile;
133131
public Entity attacker;
134132
public String knockBackDirection;

src/main/java/com/khomsi/game/entity/mobs/MobBat.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import com.khomsi.game.entity.Entity;
44
import com.khomsi.game.main.GameManager;
5-
import com.khomsi.game.objects.gui.HeartObject;
6-
import com.khomsi.game.objects.gui.ManaObject;
5+
import com.khomsi.game.objects.spells.HeartObject;
6+
import com.khomsi.game.objects.spells.ManaObject;
77
import com.khomsi.game.objects.interact.CoinBObject;
88

99
import java.util.Random;

src/main/java/com/khomsi/game/entity/mobs/MobDungeonBoss.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import com.khomsi.game.data.GameProgress;
44
import com.khomsi.game.entity.Entity;
55
import com.khomsi.game.main.GameManager;
6-
import com.khomsi.game.objects.gui.HeartObject;
7-
import com.khomsi.game.objects.gui.ManaObject;
6+
import com.khomsi.game.objects.spells.HeartObject;
7+
import com.khomsi.game.objects.spells.ManaObject;
88
import com.khomsi.game.objects.interact.CoinBObject;
99
import com.khomsi.game.objects.outside.DungeonDoorClosedObject;
1010

src/main/java/com/khomsi/game/entity/mobs/MobOrc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.khomsi.game.entity.mobs;
22

33
import com.khomsi.game.main.GameManager;
4-
import com.khomsi.game.objects.gui.ManaObject;
4+
import com.khomsi.game.objects.spells.ManaObject;
55
import com.khomsi.game.objects.interact.CoinBObject;
66
import com.khomsi.game.entity.Entity;
7-
import com.khomsi.game.objects.gui.HeartObject;
7+
import com.khomsi.game.objects.spells.HeartObject;
88

99
import java.util.Random;
1010

src/main/java/com/khomsi/game/entity/mobs/MobSlime.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.khomsi.game.entity.mobs;
22

33
import com.khomsi.game.main.GameManager;
4-
import com.khomsi.game.objects.gui.HeartObject;
5-
import com.khomsi.game.objects.gui.ManaObject;
4+
import com.khomsi.game.objects.spells.HeartObject;
5+
import com.khomsi.game.objects.spells.ManaObject;
66
import com.khomsi.game.objects.interact.CoinBObject;
77
import com.khomsi.game.entity.Entity;
88
import com.khomsi.game.objects.projectTiles.RockObject;

src/main/java/com/khomsi/game/entity/mobs/MobSlimeBlue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.khomsi.game.entity.mobs;
22

33
import com.khomsi.game.main.GameManager;
4-
import com.khomsi.game.objects.gui.ManaObject;
4+
import com.khomsi.game.objects.spells.ManaObject;
55
import com.khomsi.game.objects.interact.CoinBObject;
66
import com.khomsi.game.entity.Entity;
7-
import com.khomsi.game.objects.gui.HeartObject;
7+
import com.khomsi.game.objects.spells.HeartObject;
88

99
import java.util.Random;
1010

src/main/java/com/khomsi/game/entity/player/Player.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void setDefaultValues() {
5858
level = 1;
5959
maxHp = 6;
6060
hp = maxHp;
61-
maxMana = 4;
61+
maxMana = 6;
6262
mana = maxMana;
6363
//TODO basic var for arrows, future realisation
6464
// ammo = 10;
@@ -508,13 +508,21 @@ private void interactNpc(int npcIndex) {
508508
}
509509

510510
private void checkLevelUp() {
511+
int maxValue = 12;
511512
if (xp >= nextLevelXp) {
512513
level++;
513514
//This will make it so the exp resets but also takes into
514515
// account any exp collected that is over the nextLevelExp
515516
xp = xp - nextLevelXp;
516517
nextLevelXp = nextLevelXp * 2;
517-
maxHp += 2;
518+
// Increase maxHp by 2 if it is less than maxValue
519+
if (maxHp < maxValue) {
520+
maxHp += 2;
521+
}
522+
// Increase maxMana by 1 if it is less than maxValue
523+
if (maxMana < maxValue) {
524+
maxMana += 1;
525+
}
518526
strength++;
519527
agility++;
520528
attack = getAttack();

src/main/java/com/khomsi/game/enviroment/Lightning.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void draw(Graphics2D g2d) {
129129
}
130130
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1F));
131131
debugDayState(g2d);
132-
gameManager.ui.drawClock(g2d, dayState, filterAlfa);
132+
gameManager.ui.drawClock(dayState, filterAlfa);
133133
}
134134

135135
private void debugDayState(Graphics2D g2d) {

src/main/java/com/khomsi/game/main/logic/EntityGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
import com.khomsi.game.main.GameManager;
44
import com.khomsi.game.objects.equipment.*;
5-
import com.khomsi.game.objects.gui.ManaObject;
5+
import com.khomsi.game.objects.spells.ManaObject;
66
import com.khomsi.game.objects.interact.ChestObject;
77
import com.khomsi.game.objects.interact.CoinBObject;
88
import com.khomsi.game.objects.interact.KeyObject;
99
import com.khomsi.game.objects.outside.*;
1010
import com.khomsi.game.objects.projectTiles.FireBallObject;
1111
import com.khomsi.game.entity.Entity;
12-
import com.khomsi.game.objects.gui.HeartObject;
12+
import com.khomsi.game.objects.spells.HeartObject;
1313
import com.khomsi.game.objects.light.LanternObject;
1414
import com.khomsi.game.objects.projectTiles.MagicArrowObject;
1515
import com.khomsi.game.objects.projectTiles.RockObject;

0 commit comments

Comments
 (0)