-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sunset, win condition and win/lose screens
- Loading branch information
Showing
7 changed files
with
210 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
extends CenterContainer | ||
|
||
signal game_restarted | ||
|
||
func show_win(): | ||
%YouWin.text = "You Win" | ||
%WinDescription.text = "You managed to escape the hordes of daylight vampires till the sun was set. Now you are free and badass." | ||
show() | ||
|
||
func show_lose(elapsed_time: float): | ||
%YouWin.text = "You Lose" | ||
%WinDescription.text = "The hordes of daylight vampires got to you after %d seconds of daring espace. Tough luck." % elapsed_time | ||
show() | ||
|
||
func _on_quit_pressed() -> void: | ||
get_tree().quit() | ||
|
||
func _on_play_again_pressed() -> void: | ||
game_restarted.emit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://df4mxycb4gc4m"] | ||
|
||
[ext_resource type="Script" path="res://scenes/end_screen.gd" id="1_bhwbg"] | ||
|
||
[node name="EndScreen" type="CenterContainer"] | ||
process_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
script = ExtResource("1_bhwbg") | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="."] | ||
custom_minimum_size = Vector2(800, 0) | ||
layout_mode = 2 | ||
theme_override_constants/separation = 50 | ||
alignment = 1 | ||
|
||
[node name="YouWin" type="Label" parent="VBoxContainer"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
theme_override_colors/font_color = Color(0, 0, 0, 1) | ||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1) | ||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1) | ||
theme_override_font_sizes/font_size = 100 | ||
text = "You Win" | ||
horizontal_alignment = 1 | ||
|
||
[node name="WinDescription" type="Label" parent="VBoxContainer"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
theme_override_colors/font_color = Color(0, 0, 0, 1) | ||
theme_override_font_sizes/font_size = 20 | ||
text = "Motivational text" | ||
autowrap_mode = 2 | ||
|
||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] | ||
custom_minimum_size = Vector2(0, 50) | ||
layout_mode = 2 | ||
|
||
[node name="PlayAgain" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
text = "Play Again" | ||
|
||
[node name="Quit" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
text = "Quit" | ||
|
||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/PlayAgain" to="." method="_on_play_again_pressed"] | ||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Quit" to="." method="_on_quit_pressed"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
extends CanvasLayer | ||
|
||
|
||
func sync_life(actual_value: float): | ||
func sync_life(actual_value: float, max_value: int): | ||
%LifeBar.max_value = max_value | ||
%LifeBar.value = actual_value |