diff --git a/player.gd b/player.gd index 66ba78e..240e698 100644 --- a/player.gd +++ b/player.gd @@ -96,9 +96,14 @@ func _on_retry_button_pressed(): func _on_continue_button_pressed(): $FinishControl.visible = false $Shop.visible = true - - #stage_counter += 1 - #station_reached.emit() - #$TimeLimit.start() - #$HUD.visible = true - #stamina = max_stamina + + + +func _on_shop_shop_exit() -> void: + is_active = true + $Shop.visible = false + stage_counter += 1 + station_reached.emit() + $TimeLimit.start() + $HUD.visible = true + stamina = max_stamina diff --git a/player.tscn b/player.tscn index a580065..01324a5 100644 --- a/player.tscn +++ b/player.tscn @@ -289,6 +289,7 @@ shape = SubResource("CylinderShape3D_hqtel") debug_color = Color(0.6328197, 0.113640614, 0, 0.41960785) [connection signal="timeout" from="TimeLimit" to="." method="_on_time_limit_timeout"] +[connection signal="shop_exit" from="Shop" to="." method="_on_shop_shop_exit"] [connection signal="pressed" from="FinishControl/ContinueButton" to="." method="_on_continue_button_pressed"] [connection signal="pressed" from="FailControl/RetryButton" to="." method="_on_retry_button_pressed"] [connection signal="area_entered" from="Hurtbox" to="." method="_on_area_area_entered"] diff --git a/shop.gd b/shop.gd index 7ef4909..304f874 100644 --- a/shop.gd +++ b/shop.gd @@ -3,6 +3,8 @@ extends Control var upgrade_node: Node var available_money: int = 1000 +signal shop_exit + func _process(delta: float) -> void: $Money.text = str(available_money) @@ -34,3 +36,7 @@ func _on_tux_upgrades_item_clicked(index: int, at_position: Vector2, mouse_butto populate() else: $Error.text = "No tens prou Diners!!!!" + + +func _on_button_pressed() -> void: + shop_exit.emit() diff --git a/shop.tscn b/shop.tscn index ac25e6b..67b5f5b 100644 --- a/shop.tscn +++ b/shop.tscn @@ -121,6 +121,23 @@ offset_bottom = -270.0 grow_horizontal = 2 grow_vertical = 2 +[node name="Button" type="Button" parent="." unique_id=1169928484] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = 387.0 +offset_top = 249.0 +offset_right = 550.0 +offset_bottom = 302.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_font_sizes/font_size = 32 +text = "Continuar" + [connection signal="mouse_entered" from="Tux" to="." method="_on_tux_mouse_entered"] [connection signal="mouse_exited" from="Tux" to="." method="_on_tux_mouse_exited"] [connection signal="item_clicked" from="TuxUpgrades" to="." method="_on_tux_upgrades_item_clicked"] +[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]