add sleeping functionality to Tent object and update player image handling
This commit is contained in:
@@ -409,8 +409,10 @@ public class UI {
|
||||
if(panel.eManager.lighting.filterAlpha <= 0F) {
|
||||
panel.eManager.lighting.filterAlpha = 0F;
|
||||
sleepCount = 0;
|
||||
panel.eManager.lighting.dayCount = 0;
|
||||
panel.eManager.lighting.dayState = Lighting.DayState.DAY;
|
||||
panel.gameState = GameState.PLAY;
|
||||
panel.player.getPlayerImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import de.miaurizius.jgame2d.entity.item.SwordNormalObj;
|
||||
import de.miaurizius.jgame2d.entity.projectile.FireballObj;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class Player extends Entity {
|
||||
|
||||
@@ -307,6 +308,16 @@ public class Player extends Entity {
|
||||
life = maxLife;
|
||||
invincible = false;
|
||||
}
|
||||
public void getSleepingImage(BufferedImage image) {
|
||||
down1 = image;
|
||||
down2 = image;
|
||||
up1 = image;
|
||||
up2 = image;
|
||||
left1 = image;
|
||||
left2 = image;
|
||||
right1 = image;
|
||||
right2 = image;
|
||||
}
|
||||
|
||||
// SETTING THINGS UP
|
||||
public void setDefaultValues() {
|
||||
|
||||
@@ -25,6 +25,7 @@ public class TentObj extends Entity {
|
||||
panel.playSE(14);
|
||||
panel.player.life = panel.player.maxLife;
|
||||
panel.player.mana = panel.player.maxMana;
|
||||
panel.player.getSleepingImage(down1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public class Lighting {
|
||||
|
||||
GamePanel panel;
|
||||
BufferedImage darknessFilter;
|
||||
int dayCount;
|
||||
public int dayCount;
|
||||
public DayState dayState = DayState.DAY;
|
||||
public float filterAlpha;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user