diff --git a/Scenes/Main/main.gd b/Scenes/Main/main.gd index 4a7c8c3..69fb57c 100644 --- a/Scenes/Main/main.gd +++ b/Scenes/Main/main.gd @@ -20,3 +20,9 @@ func _getMousePosition(event: InputEvent): func get_cell_information(cell): print(cell) + +func ResetLevel(): + get_tree().reload_current_scene() + +func ResetPlayer(): + $Player.reset(Vector2(50, 50)) diff --git a/Scenes/Main/main.tscn b/Scenes/Main/main.tscn index 12e8138..8cbb977 100644 --- a/Scenes/Main/main.tscn +++ b/Scenes/Main/main.tscn @@ -62,13 +62,52 @@ offset_bottom = 40.0 [node name="PanelContainer" type="PanelContainer" parent="HUD/GridDisplay/MarginContainer"] layout_mode = 2 -[node name="ShowGrid" type="CheckBox" parent="HUD/GridDisplay/MarginContainer/PanelContainer"] +[node name="VBoxContainer" type="HBoxContainer" parent="HUD/GridDisplay/MarginContainer/PanelContainer"] +layout_mode = 2 + +[node name="ShowGrid" type="CheckBox" parent="HUD/GridDisplay/MarginContainer/PanelContainer/VBoxContainer"] layout_mode = 2 text = "Show Grid" +[node name="ShowMove" type="CheckBox" parent="HUD/GridDisplay/MarginContainer/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Show Movement Range" + +[node name="GameControl" type="Control" parent="HUD"] +layout_mode = 3 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -40.0 +offset_right = 40.0 +grow_vertical = 0 +size_flags_horizontal = 0 +size_flags_vertical = 8 + +[node name="MarginContainer" type="MarginContainer" parent="HUD/GameControl"] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="PanelContainer" type="PanelContainer" parent="HUD/GameControl/MarginContainer"] +layout_mode = 2 + +[node name="VBoxContainer" type="HBoxContainer" parent="HUD/GameControl/MarginContainer/PanelContainer"] +layout_mode = 2 + +[node name="ResetLevel" type="Button" parent="HUD/GameControl/MarginContainer/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Reset Level" + +[node name="ResetPlayer" type="Button" parent="HUD/GameControl/MarginContainer/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Reset Player" + [node name="Player" parent="." instance=ExtResource("9_hryqi")] position = Vector2(150, 150) [connection signal="accept_pressed" from="GameBoard/Cursor" to="." method="get_cell_information"] -[connection signal="toggled" from="HUD/GridDisplay/MarginContainer/PanelContainer/ShowGrid" to="HUD/GridDisplay" method="toggle_grid_display"] -[connection signal="MoveFinished" from="Player" to="HUD/GridDisplay" method="_on_player_move_finished"] +[connection signal="toggled" from="HUD/GridDisplay/MarginContainer/PanelContainer/VBoxContainer/ShowGrid" to="HUD/GridDisplay" method="toggle_grid_display"] +[connection signal="toggled" from="HUD/GridDisplay/MarginContainer/PanelContainer/VBoxContainer/ShowMove" to="HUD/GridDisplay" method="toggle_move_range"] +[connection signal="pressed" from="HUD/GameControl/MarginContainer/PanelContainer/VBoxContainer/ResetLevel" to="." method="ResetLevel"] +[connection signal="pressed" from="HUD/GameControl/MarginContainer/PanelContainer/VBoxContainer/ResetPlayer" to="." method="ResetPlayer"]