miawwwww its epic
This commit is contained in:
parent
af8662fd6a
commit
f510a916f7
21 changed files with 400 additions and 16 deletions
|
|
@ -6,6 +6,7 @@ var starting_time : int = 200
|
|||
@export var bar : TextureProgressBar
|
||||
@export var timer_text : Label
|
||||
@export var days_text : Label
|
||||
@export var next_button : Button
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
|
@ -17,6 +18,11 @@ func _process(delta: float) -> void:
|
|||
bar.value = (starting_time-time_left)/float(starting_time)
|
||||
timer_text.text = str(time_left)
|
||||
days_text.text = str(days_left)
|
||||
next_button.disabled = time_left > 10
|
||||
if days_left == 0:
|
||||
next_button.text = "End Game"
|
||||
else:
|
||||
next_button.text = "Proceed to next day ->"
|
||||
|
||||
func has_time(time : float) -> bool:
|
||||
return time_left >= time
|
||||
|
|
@ -26,5 +32,11 @@ func use_time(time : float):
|
|||
|
||||
|
||||
func _on_next_day_pressed() -> void:
|
||||
days_left -= 1
|
||||
time_left = 200
|
||||
if days_left >= 1:
|
||||
days_left -= 1
|
||||
time_left = 200
|
||||
else:
|
||||
get_tree().change_scene_to_file("res://scenes/ending.tscn")
|
||||
PlayerInventory.hide()
|
||||
Clock.hide()
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
[sub_resource type="LabelSettings" id="LabelSettings_r3ygl"]
|
||||
font_size = 32
|
||||
|
||||
[node name="Clock" type="Control" node_paths=PackedStringArray("bar", "timer_text", "days_text")]
|
||||
[node name="Clock" type="Control" node_paths=PackedStringArray("bar", "timer_text", "days_text", "next_button")]
|
||||
z_index = 2
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
|
|
@ -21,6 +21,7 @@ script = ExtResource("1_m6rn1")
|
|||
bar = NodePath("PanelContainer/VBoxContainer/HBoxContainer/TextureProgressBar")
|
||||
timer_text = NodePath("PanelContainer/VBoxContainer/HBoxContainer/TextureProgressBar/PanelContainer/Label")
|
||||
days_text = NodePath("PanelContainer/VBoxContainer/HBoxContainer/VBoxContainer/Label")
|
||||
next_button = NodePath("PanelContainer/VBoxContainer/NextDay")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue