forked from 2121578/gai-ca2
Fixed temperature bar
parent
5c0fc2beed
commit
7d5f91adcb
|
@ -66,19 +66,18 @@ func update_bars() -> void:
|
|||
if health_bar != null:
|
||||
health_bar.max_value = player.max_health
|
||||
health_bar.value = clamp(player.health, 0, player.max_health)
|
||||
$Camera2D/CanvasLayer/HealthLabel.text = str(player.health) + "/" + str(player.max_health)
|
||||
$Camera2D/CanvasLayer/HealthLabel.text = str(health_bar.value) + "/" + str(player.max_health)
|
||||
$Camera2D/CanvasLayer/HealthLabel.add_theme_color_override("font_color", Color(1, 1, 1))
|
||||
|
||||
if food_bar != null:
|
||||
food_bar.max_value = player.max_food
|
||||
food_bar.value = clamp(player.food, 0, player.max_food)
|
||||
$Camera2D/CanvasLayer/FoodLabel.text = str(player.food) + "/" + str(player.max_food)
|
||||
$Camera2D/CanvasLayer/FoodLabel.text = str(food_bar.value) + "/" + str(player.max_food)
|
||||
|
||||
if temperature_bar != null:
|
||||
var temperature_value: int = player.temperature_endure - player.temperature_timer
|
||||
temperature_bar.max_value = player.temperature_endure
|
||||
temperature_bar.value = clamp(temperature_value, 0, player.temperature_endure)
|
||||
$Camera2D/CanvasLayer/TemperatureLabel.text = str(player.temperature_endure) + "/" + str(player.max_temperature)
|
||||
temperature_bar.max_value = player.temperature_set_buff_value
|
||||
temperature_bar.value = clamp(player.temperature_buff_timer, 0, player.temperature_set_buff_value)
|
||||
$Camera2D/CanvasLayer/TemperatureLabel.text = str(temperature_bar.value) + "/" + str(player.temperature_set_buff_value)
|
||||
|
||||
|
||||
func toggle_temperature_layer() -> void:
|
||||
|
|
Loading…
Reference in New Issue