diff --git a/game.tscn b/game.tscn index 9ca313d..a7623b7 100644 --- a/game.tscn +++ b/game.tscn @@ -61,7 +61,7 @@ music_player = NodePath("MusicPlayer") win_player = NodePath("WinMusic") flyover_player = NodePath("Flyover") intro_player = NodePath("IntroPlayer") -start_button = NodePath("GameUI/Button") +start_button = NodePath("GameUI/StartButton") [node name="Sprite2D" type="Sprite2D" parent="."] texture_filter = 1 @@ -319,7 +319,7 @@ text = "Scoreboard" [node name="scorecard_container" type="VBoxContainer" parent="GameUI/Scoreboard/VBoxContainer"] layout_mode = 2 -[node name="Button" type="Button" parent="GameUI"] +[node name="StartButton" type="Button" parent="GameUI"] layout_mode = 0 offset_left = 132.0 offset_top = 97.0 @@ -327,6 +327,14 @@ offset_right = 228.0 offset_bottom = 128.0 text = "Start Game" +[node name="ResetButton" type="Button" parent="GameUI"] +layout_mode = 0 +offset_left = 170.0 +offset_top = -125.0 +offset_right = 228.0 +offset_bottom = -94.0 +text = "Reset" + [node name="PlayerSpawns" type="Node2D" parent="."] [node name="Point" type="CollisionShape2D" parent="PlayerSpawns"] @@ -474,5 +482,6 @@ stream = ExtResource("7_j5wjh") volume_db = -20.037 autoplay = true -[connection signal="pressed" from="GameUI/Button" to="." method="_on_start_button_pressed"] +[connection signal="pressed" from="GameUI/StartButton" to="." method="_on_start_button_pressed"] +[connection signal="pressed" from="GameUI/ResetButton" to="." method="_on_reset_button_pressed"] [connection signal="finished" from="IntroPlayer" to="." method="_on_intro_player_finished"] diff --git a/gameManager.gd b/gameManager.gd index 265fc03..0c0b74b 100644 --- a/gameManager.gd +++ b/gameManager.gd @@ -152,3 +152,7 @@ func _on_start_button_pressed() -> void: flyover_player.stop() intro_player.play() start_button.disabled = true + + +func _on_reset_button_pressed() -> void: + get_tree().reload_current_scene() diff --git a/project.godot b/project.godot index 83cc1e2..13e83bc 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,10 @@ run/main_scene="uid://jo1lu66y1gx6" config/features=PackedStringArray("4.4", "GL Compatibility") config/icon="res://icon.svg" +[autoload] + +Twitch="*res://twitch.tscn" + [display] window/stretch/mode="canvas_items" diff --git a/twitch.gd b/twitch.gd new file mode 100644 index 0000000..61510e1 --- /dev/null +++ b/twitch.gd @@ -0,0 +1 @@ +extends Node diff --git a/twitch.gd.uid b/twitch.gd.uid new file mode 100644 index 0000000..06f20a2 --- /dev/null +++ b/twitch.gd.uid @@ -0,0 +1 @@ +uid://damxpifvhhb78 diff --git a/twitch.tscn b/twitch.tscn new file mode 100644 index 0000000..33ab98c --- /dev/null +++ b/twitch.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://cg12qp1rk55ai"] + +[ext_resource type="Script" uid="uid://damxpifvhhb78" path="res://twitch.gd" id="1_xmflv"] + +[node name="Twitch" type="Node"] +script = ExtResource("1_xmflv")