diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/Player.java b/core/src/ru/deadsoftware/cavedroid/game/mobs/Player.java
index 8fce1169be150a7a5e568adf1925ef6cb014afd2..ebdd9c0dbed6281204809267f6ed0997f270925b 100644 (file)
private static final float SPEED = 69.072f;
private static final float JUMP_VELOCITY = -133.332f;
+ private static final int MAX_HEALTH = 20;
private boolean hitting = false;
private float hitAnim = 0f;
public float headRotation = 0f;
public Player() {
- super(0, 0, 4, 30, randomDir(), Type.MOB);
+ super(0, 0, 4, 30, randomDir(), Type.MOB, MAX_HEALTH);
this.gameMode = 1;
inventory = new int[9];
swim = false;
this.y = pos.y;
mVelocity.setZero();
mDead = false;
+ heal(MAX_HEALTH);
}
public void pickUpDrop(Drop drop) {
public void changeDir() {
}
+ @Override
+ public void damage(int damage) {
+ if (gameMode == 1) {
+ return;
+ }
+ super.damage(damage);
+ }
+
+ @Override
+ public void heal(int heal) {
+ if (gameMode == 1) {
+ return;
+ }
+ super.heal(heal);
+ }
+
private void drawItem(SpriteBatch spriteBatch, float x, float y, float anim) {
final int itemId = inventory[slot];
final Item item = GameItems.getItem(itemId);