Add method updating ui based on player stats
This commit is contained in:
parent
a60a46cc53
commit
0fb5f925d2
12
src/ui/Ui.py
12
src/ui/Ui.py
@ -2,6 +2,7 @@ from enum import Enum
|
||||
|
||||
import pygame
|
||||
|
||||
from src.entities.Statistics import Statistics
|
||||
from src.ui.UiBar import UiBar
|
||||
from src.ui.UiConsole import UiConsole
|
||||
from src.ui.UiText import UiText
|
||||
@ -50,6 +51,17 @@ class Ui():
|
||||
screenHeight - self.timerTextView.rect.h - self.isDayTextView.rect.h),
|
||||
font=self.font)
|
||||
|
||||
def updateBasedOnPlayerStats(self, statistics: Statistics):
|
||||
self.healthBar.updateFill(statistics.hp)
|
||||
self.hungerBar.updateFill(statistics.hunger)
|
||||
self.staminaBar.updateFill(statistics.stamina)
|
||||
self.thirstBar.updateFill(statistics.thirst)
|
||||
|
||||
def updateBasedOnPygameEvent(self, event: pygame.event):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
class Colors(Enum):
|
||||
RED = (255, 0, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user