diff options
Diffstat (limited to 'godot')
-rw-r--r-- | godot/project.godot | 2 | ||||
-rw-r--r-- | godot/scenes/Game.gd | 7 | ||||
-rw-r--r-- | godot/scenes/Game.tscn | 15 | ||||
-rw-r--r-- | godot/scenes/Menu.tscn | 55 | ||||
-rw-r--r-- | godot/scenes/Rotator.gd | 12 | ||||
-rw-r--r-- | godot/scenes/levels/MainMenu.tscn | 20 |
6 files changed, 100 insertions, 11 deletions
diff --git a/godot/project.godot b/godot/project.godot index 428c9cf..a14afe0 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -15,7 +15,7 @@ _global_script_class_icons={ [application] config/name="code-with-your-friends2022" -run/main_scene="res://scenes/Menu.tscn" +run/main_scene="res://scenes/levels/MainMenu.tscn" config/icon="res://assets/godot-ferris-32x32.png" [display] diff --git a/godot/scenes/Game.gd b/godot/scenes/Game.gd index 58c9e27..d2dc2ed 100644 --- a/godot/scenes/Game.gd +++ b/godot/scenes/Game.gd @@ -41,6 +41,11 @@ func _on_ResumeButton_pressed(): Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) +func _on_MainMenuButton_pressed(): + get_tree().paused = false + get_tree().change_scene("res://scenes/levels/MainMenu.tscn") + + func end_level(): # save current strokes and reset strokes_per_level[current_level_id] = current_strokes @@ -80,7 +85,7 @@ func next_level(): current_level_id = current_level_id + 1 if current_level_id >= NUM_LEVELS: - # TODO load main menu + get_tree().change_scene("res://scenes/levels/MainMenu.tscn") return # load next level diff --git a/godot/scenes/Game.tscn b/godot/scenes/Game.tscn index 60a965d..411b825 100644 --- a/godot/scenes/Game.tscn +++ b/godot/scenes/Game.tscn @@ -58,16 +58,23 @@ custom_constants/separation = 20 alignment = 1 [node name="ResumeButton" type="Button" parent="PausePopup/Panel/VBoxContainer"] -margin_top = 161.0 +margin_top = 110.0 margin_right = 360.0 -margin_bottom = 242.0 +margin_bottom = 191.0 text = "Resume" +[node name="MainMenuButton" type="Button" parent="PausePopup/Panel/VBoxContainer"] +margin_top = 211.0 +margin_right = 360.0 +margin_bottom = 292.0 +text = "Main Menu" + [node name="QuitButton" type="Button" parent="PausePopup/Panel/VBoxContainer"] -margin_top = 262.0 +margin_top = 312.0 margin_right = 360.0 -margin_bottom = 343.0 +margin_bottom = 393.0 text = "Quit" [connection signal="pressed" from="PausePopup/Panel/VBoxContainer/ResumeButton" to="." method="_on_ResumeButton_pressed"] +[connection signal="pressed" from="PausePopup/Panel/VBoxContainer/MainMenuButton" to="." method="_on_MainMenuButton_pressed"] [connection signal="pressed" from="PausePopup/Panel/VBoxContainer/QuitButton" to="." method="_on_QuitButton_pressed"] diff --git a/godot/scenes/Menu.tscn b/godot/scenes/Menu.tscn index 792bc28..8ee96d2 100644 --- a/godot/scenes/Menu.tscn +++ b/godot/scenes/Menu.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=3 format=2] [ext_resource path="res://assets/theme.tres" type="Theme" id=1] [ext_resource path="res://scenes/Menu.gd" type="Script" id=2] -[ext_resource path="res://assets/sounds/main_menu.mp3" type="AudioStream" id=3] [node name="Menu" type="Control"] anchor_right = 1.0 @@ -39,9 +38,55 @@ margin_bottom = 251.0 focus_neighbour_bottom = NodePath("../StartButton") text = "Quit" -[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] -stream = ExtResource( 3 ) -autoplay = true +[node name="Label" type="Label" parent="."] +margin_left = 584.0 +margin_top = 28.0 +margin_right = 1304.0 +margin_bottom = 156.0 +theme = ExtResource( 1 ) +text = "Golf with your Dice" +align = 1 +valign = 1 + +[node name="Credits" type="VBoxContainer" parent="."] +anchor_left = 0.8 +anchor_top = 0.6 +anchor_right = 1.0 +anchor_bottom = 7.0 + +[node name="Label" type="Label" parent="Credits"] +margin_right = 384.0 +margin_bottom = 51.0 +theme = ExtResource( 1 ) +text = "CREDITS" + +[node name="RichTextLabel" type="RichTextLabel" parent="Credits"] +margin_top = 55.0 +margin_right = 384.0 +margin_bottom = 370.0 +theme = ExtResource( 1 ) +text = "PROGRAMMING +[Celeste] +[Ice] +[Perivesta] + + +ART +[Scarabeaver] + + +MUSIC FROM FREESOUND:ORG: + +Main Menu: +\"Relaxing Music\" by Migfus20 +https://freesound.org/s/586538/ + +In Game: +\"Background Music\" by Migfus20 +https://freesound.org/s/586838/ + +" +fit_content_height = true [connection signal="pressed" from="VBoxContainer/StartButton" to="." method="_on_StartButton_pressed"] [connection signal="pressed" from="VBoxContainer/QuitButton" to="." method="_on_QuitButton_pressed"] diff --git a/godot/scenes/Rotator.gd b/godot/scenes/Rotator.gd new file mode 100644 index 0000000..5593d98 --- /dev/null +++ b/godot/scenes/Rotator.gd @@ -0,0 +1,12 @@ +extends Spatial + +var sum_delta = 0 + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +func _process(delta): + sum_delta += delta + global_rotate(Vector3.UP, delta) + global_rotate(Vector3.FORWARD, -delta) diff --git a/godot/scenes/levels/MainMenu.tscn b/godot/scenes/levels/MainMenu.tscn new file mode 100644 index 0000000..a91b3fa --- /dev/null +++ b/godot/scenes/levels/MainMenu.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://scenes/Menu.tscn" type="PackedScene" id=1] +[ext_resource path="res://assets/game_objects/W8.gltf" type="PackedScene" id=2] +[ext_resource path="res://scenes/Rotator.gd" type="Script" id=3] +[ext_resource path="res://assets/sounds/main_menu.mp3" type="AudioStream" id=4] + +[node name="MainMenu" type="Spatial"] + +[node name="Menu" parent="." instance=ExtResource( 1 )] + +[node name="W8" parent="." instance=ExtResource( 2 )] +script = ExtResource( 3 ) + +[node name="Camera" type="Camera" parent="."] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 5, 0 ) + +[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource( 4 ) +autoplay = true |