Compare commits
No commits in common. "e36bbd36dc29431ff930d3c453b41fb024baf7af" and "e280b7dc72afd1f01e7cf9b14e1c81429b229630" have entirely different histories.
e36bbd36dc
...
e280b7dc72
|
@ -47,21 +47,19 @@ text = "INV"
|
|||
|
||||
[node name="HealthBar" type="ProgressBar" parent="Camera2D/CanvasLayer/VBoxContainer"]
|
||||
modulate = Color(0.787561, 0.0888135, 0.00437393, 1)
|
||||
custom_minimum_size = Vector2(150, 20)
|
||||
custom_minimum_size = Vector2(150, 15)
|
||||
layout_mode = 2
|
||||
tooltip_text = "
|
||||
"
|
||||
show_percentage = false
|
||||
|
||||
[node name="FoodBar" type="ProgressBar" parent="Camera2D/CanvasLayer/VBoxContainer"]
|
||||
modulate = Color(0.166826, 0.552224, 0.153144, 1)
|
||||
custom_minimum_size = Vector2(0, 20)
|
||||
custom_minimum_size = Vector2(0, 15)
|
||||
layout_mode = 2
|
||||
show_percentage = false
|
||||
|
||||
[node name="TemperatureBar" type="ProgressBar" parent="Camera2D/CanvasLayer/VBoxContainer"]
|
||||
modulate = Color(0.0235294, 0.0392157, 1, 1)
|
||||
custom_minimum_size = Vector2(0, 20)
|
||||
custom_minimum_size = Vector2(0, 15)
|
||||
layout_mode = 2
|
||||
max_value = 50.0
|
||||
show_percentage = false
|
||||
|
@ -71,22 +69,6 @@ layout_mode = 2
|
|||
expand_mode = 5
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="HealthLabel" type="Label" parent="Camera2D/CanvasLayer"]
|
||||
offset_left = 1.0
|
||||
offset_top = 26.0
|
||||
offset_right = 151.0
|
||||
offset_bottom = 49.0
|
||||
|
||||
[node name="FoodLabel" type="Label" parent="Camera2D/CanvasLayer"]
|
||||
offset_top = 50.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 73.0
|
||||
|
||||
[node name="TemperatureLabel" type="Label" parent="Camera2D/CanvasLayer"]
|
||||
offset_top = 74.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 97.0
|
||||
|
||||
[node name="Tileset" type="Node2D" parent="."]
|
||||
script = ExtResource("1_k0rw8")
|
||||
|
||||
|
|
|
@ -22,6 +22,9 @@ func _ready() -> void:
|
|||
world.camp_manager.game_manager = self
|
||||
world.step_visualizer.game_manager = self
|
||||
world.step_visualizer.world = world
|
||||
health_bar.value = player.max_health
|
||||
food_bar.value = player.max_food
|
||||
temperature_bar.value = player.temperature_endure
|
||||
update_bars()
|
||||
$Camera2D/CanvasLayer/VBoxContainer/TextureRect.texture = world.tilemap_interactive.get_cell_texture(tilemap_types.OBJECT_I_BOAT_PART_CHEST)
|
||||
|
||||
|
@ -65,19 +68,15 @@ 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.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)
|
||||
|
||||
if temperature_bar != null:
|
||||
var temperature_value = 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)
|
||||
|
||||
|
||||
func toggle_temperature_layer() -> void:
|
||||
|
|
|
@ -10,8 +10,6 @@ extends Node
|
|||
@export var food_addon_per_berry: int = 100
|
||||
@export var food_critical_threshold: int = 50
|
||||
# temperature
|
||||
@export var max_temperature: int = 50
|
||||
@export var temperature: int
|
||||
@export var temperature_damage: int = 1
|
||||
@export var temperature_endure: int = 50
|
||||
# viewing
|
||||
|
|
Loading…
Reference in New Issue