-
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.
- Loading branch information
1 parent
a2bd575
commit 56faf33
Showing
7 changed files
with
126 additions
and
6 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
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://cq5e6witw2k2u"] | ||
|
||
[ext_resource type="Script" path="res://Scripts/Win.gd" id="1_dknb4"] | ||
|
||
[node name="Win" type="Control"] | ||
process_mode = 3 | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
script = ExtResource("1_dknb4") | ||
|
||
[node name="Canvas" type="CanvasLayer" parent="."] | ||
|
||
[node name="ColorRect" type="ColorRect" parent="Canvas"] | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
color = Color(0.0901961, 0.894118, 1, 0.356863) | ||
metadata/_edit_use_anchors_ = true | ||
|
||
[node name="YouWin" type="Label" parent="Canvas"] | ||
anchors_preset = 10 | ||
anchor_right = 1.0 | ||
offset_top = 159.0 | ||
offset_right = -826.0 | ||
offset_bottom = 250.0 | ||
grow_horizontal = 2 | ||
scale = Vector2(1.74971, 1.70331) | ||
theme_override_font_sizes/font_size = 64 | ||
text = "You Win!" | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 | ||
metadata/_edit_use_anchors_ = true | ||
|
||
[node name="Message" type="Label" parent="Canvas"] | ||
anchors_preset = 10 | ||
anchor_right = 1.0 | ||
offset_top = 354.0 | ||
offset_bottom = 627.0 | ||
grow_horizontal = 2 | ||
theme_override_font_sizes/font_size = 64 | ||
text = "Bacterium Killed: 0 | ||
Colonies Destroyed: 0 | ||
Elapsed Time: 0:00" | ||
horizontal_alignment = 1 | ||
metadata/_edit_use_anchors_ = true | ||
|
||
[node name="PlayAgain" type="Button" parent="Canvas"] | ||
offset_left = 723.0 | ||
offset_top = 682.0 | ||
offset_right = 1175.0 | ||
offset_bottom = 809.0 | ||
theme_override_font_sizes/font_size = 64 | ||
text = "Play Again?" | ||
metadata/_edit_use_anchors_ = true | ||
|
||
[node name="Quit" type="Button" parent="Canvas"] | ||
offset_left = 723.0 | ||
offset_top = 850.0 | ||
offset_right = 1175.0 | ||
offset_bottom = 977.0 | ||
theme_override_font_sizes/font_size = 64 | ||
text = "Quit" | ||
metadata/_edit_use_anchors_ = true | ||
|
||
[connection signal="pressed" from="Canvas/PlayAgain" to="." method="_on_play_again_pressed"] | ||
[connection signal="pressed" from="Canvas/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
extends Control | ||
|
||
@export var quit_scene : PackedScene | ||
# Called when the node enters the scene tree for the first time. | ||
func _ready(): | ||
$Canvas.visible = false | ||
|
||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame. | ||
func _process(delta): | ||
pass | ||
|
||
func win(time): | ||
$Canvas/Message.text = "Bacterium Killed: %d\nColonies Destroyed: %d\nElapsed Time: %s" %[GlobalState.enemies_destroyed, GlobalState.colonies_destroyed, time] | ||
$Canvas.visible = true | ||
get_tree().paused = true | ||
|
||
|
||
func _on_play_again_pressed(): | ||
GlobalState.reset_state() | ||
get_tree().paused = false | ||
get_tree().reload_current_scene() | ||
|
||
|
||
func _on_quit_pressed(): | ||
if OS.get_name() == "Web": | ||
get_tree().change_scene_to_packed(quit_scene) | ||
else: | ||
get_tree().quit() |
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