implement the new main menu into the actual game
This commit is contained in:
parent
a73b32610e
commit
8f18e43af7
6 changed files with 96 additions and 226 deletions
|
@ -96,6 +96,7 @@ spot_range = 50.0
|
||||||
collision_priority = 100.0
|
collision_priority = 100.0
|
||||||
axis_lock_linear_z = true
|
axis_lock_linear_z = true
|
||||||
physics_material_override = SubResource("PhysicsMaterial_vumbr")
|
physics_material_override = SubResource("PhysicsMaterial_vumbr")
|
||||||
|
can_sleep = false
|
||||||
contact_monitor = true
|
contact_monitor = true
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Sphere"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Sphere"]
|
||||||
|
|
234
index.tscn
234
index.tscn
|
@ -1,6 +1,4 @@
|
||||||
[gd_scene load_steps=11 format=3 uid="uid://ccgnnif026wb4"]
|
[gd_scene load_steps=4 format=3 uid="uid://ccgnnif026wb4"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dtfybhftwfn00" path="res://levels/demo.tscn" id="1_356j3"]
|
|
||||||
|
|
||||||
[sub_resource type="GDScript" id="GDScript_8n212"]
|
[sub_resource type="GDScript" id="GDScript_8n212"]
|
||||||
script/source = "extends Node
|
script/source = "extends Node
|
||||||
|
@ -15,6 +13,7 @@ var levels = [
|
||||||
preload(\"res://levels/forest/level.tscn\"),
|
preload(\"res://levels/forest/level.tscn\"),
|
||||||
preload(\"res://levels/night/level.tscn\"),
|
preload(\"res://levels/night/level.tscn\"),
|
||||||
]
|
]
|
||||||
|
var area_resource = preload(\"res://menus/main/area.tscn\")
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
var os_name = OS.get_name()
|
var os_name = OS.get_name()
|
||||||
|
@ -26,19 +25,25 @@ func _ready() -> void:
|
||||||
$PauseMenu.hide()
|
$PauseMenu.hide()
|
||||||
## Add the version of the game and the name of the OS to the footer of the start menu
|
## Add the version of the game and the name of the OS to the footer of the start menu
|
||||||
if OS.has_feature(\"editor\"):
|
if OS.has_feature(\"editor\"):
|
||||||
$StartMenu/VBoxContainer/MarginContainer2/Notice.text = \"dev \"
|
$DevInfos.text = \"dev \"
|
||||||
$StartMenu/VBoxContainer/MarginContainer2/Notice.text += \"build \" + ProjectSettings.get_setting(\"application/config/version\") + \" (\" + os_name + \")\"
|
$DevInfos.text += \"build \" + ProjectSettings.get_setting(\"application/config/version\") + \" (\" + os_name + \")\"
|
||||||
|
launch_area()
|
||||||
|
|
||||||
|
func launch_area():
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
|
var area := area_resource.instantiate()
|
||||||
|
area.connect(\"request_start\", start_game)
|
||||||
|
$Levels.add_child(area)
|
||||||
|
|
||||||
## Get all the levels that are currently being played!
|
## Get all the levels that are currently being played!
|
||||||
## In theory, there should ever be only zero or one,
|
## In theory, there should ever be only zero or one,
|
||||||
## but it turns out it's more simple to handle things by using Arrays.
|
## but it turns out it's more simple to handle things by using Arrays.
|
||||||
func get_current_levels() -> Array[Level]:
|
func get_current_levels() -> Array[Level]:
|
||||||
var children = $Levels.get_children(true)
|
var children := $Levels.get_children(true)
|
||||||
var current_levels: Array[Level] = []
|
var current_levels: Array[Level] = []
|
||||||
for child in children:
|
for child in children:
|
||||||
if is_instance_of(child, Level):
|
if is_instance_of(child, Level):
|
||||||
current_levels.push_back(child)
|
current_levels.push_back(child)
|
||||||
|
|
||||||
return current_levels
|
return current_levels
|
||||||
|
|
||||||
func start_level(level_scene: PackedScene) -> void:
|
func start_level(level_scene: PackedScene) -> void:
|
||||||
|
@ -74,10 +79,8 @@ func stop_level() -> void:
|
||||||
func win_game() -> void:
|
func win_game() -> void:
|
||||||
$VictoryScreen.show()
|
$VictoryScreen.show()
|
||||||
await get_tree().create_timer(2).timeout
|
await get_tree().create_timer(2).timeout
|
||||||
$StartMenu/AnimationPlayer.play_backwards(\"fadeout\")
|
launch_area()
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
$VictoryScreen.hide()
|
||||||
await get_tree().create_timer(1).timeout
|
|
||||||
$StartMenu.modulate = Color(1,1,1,1)
|
|
||||||
|
|
||||||
func restart_level() -> void:
|
func restart_level() -> void:
|
||||||
if changing_level == false:
|
if changing_level == false:
|
||||||
|
@ -110,25 +113,18 @@ func fullscreen_game() -> void:
|
||||||
else:
|
else:
|
||||||
DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_WINDOWED)
|
DisplayServer.window_set_mode(DisplayServer.WindowMode.WINDOW_MODE_WINDOWED)
|
||||||
|
|
||||||
func _on_btn_start_pressed() -> void:
|
func start_game() -> void:
|
||||||
seconds_spent = 0.0
|
seconds_spent = 0.0
|
||||||
current_level_int = 0
|
current_level_int = 0
|
||||||
|
|
||||||
var current_levels = get_current_levels()
|
var current_levels = $Levels.get_children(true)
|
||||||
for level in current_levels:
|
for level in current_levels:
|
||||||
level.queue_free()
|
level.queue_free()
|
||||||
|
|
||||||
$Informations.show()
|
$Informations.show()
|
||||||
$StartMenu/AnimationPlayer.play(\"fadeout\")
|
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||||
start_level(levels[0])
|
start_level(levels[0])
|
||||||
|
|
||||||
func _on_animation_player_animation_finished(_anim_name: StringName) -> void:
|
|
||||||
if $StartMenu.modulate == Color(1,1,1,1):
|
|
||||||
$StartMenu.show()
|
|
||||||
else:
|
|
||||||
$StartMenu.hide()
|
|
||||||
|
|
||||||
func update_timer(delta: float) -> void:
|
func update_timer(delta: float) -> void:
|
||||||
if playing:
|
if playing:
|
||||||
seconds_spent += delta
|
seconds_spent += delta
|
||||||
|
@ -145,7 +141,8 @@ func _process(delta: float) -> void:
|
||||||
|
|
||||||
func _unhandled_key_input(event: InputEvent) -> void:
|
func _unhandled_key_input(event: InputEvent) -> void:
|
||||||
if event.is_pressed() and event is InputEventKey:
|
if event.is_pressed() and event is InputEventKey:
|
||||||
if $StartMenu.visible == false and changing_level == false:
|
var current_levels := get_current_levels()
|
||||||
|
if len(current_levels) and changing_level == false:
|
||||||
if event.keycode == KEY_ESCAPE:
|
if event.keycode == KEY_ESCAPE:
|
||||||
pause_game()
|
pause_game()
|
||||||
elif event.keycode == KEY_R:
|
elif event.keycode == KEY_R:
|
||||||
|
@ -166,61 +163,6 @@ font_size = 160
|
||||||
outline_size = 20
|
outline_size = 20
|
||||||
outline_color = Color(0, 0, 0, 1)
|
outline_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_0jegv"]
|
|
||||||
font_size = 32
|
|
||||||
shadow_size = 2
|
|
||||||
shadow_color = Color(0, 0, 0, 1)
|
|
||||||
shadow_offset = Vector2(0, 0)
|
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_nbp4i"]
|
|
||||||
font_size = 24
|
|
||||||
shadow_size = 2
|
|
||||||
shadow_color = Color(0, 0, 0, 1)
|
|
||||||
shadow_offset = Vector2(0, 0)
|
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_5jdmh"]
|
|
||||||
font_size = 20
|
|
||||||
shadow_size = 2
|
|
||||||
shadow_color = Color(0, 0, 0, 1)
|
|
||||||
shadow_offset = Vector2(0, 0)
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_glb01"]
|
|
||||||
length = 0.001
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath(".:modulate")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Color(1, 1, 1, 1)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_75r06"]
|
|
||||||
resource_name = "fadeout"
|
|
||||||
step = 0.5
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath(".:modulate")
|
|
||||||
tracks/0/interp = 2
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 1),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5cb2g"]
|
|
||||||
_data = {
|
|
||||||
&"RESET": SubResource("Animation_glb01"),
|
|
||||||
&"fadeout": SubResource("Animation_75r06")
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="Game" type="Node"]
|
[node name="Game" type="Node"]
|
||||||
script = SubResource("GDScript_8n212")
|
script = SubResource("GDScript_8n212")
|
||||||
|
|
||||||
|
@ -293,133 +235,6 @@ vertical_alignment = 1
|
||||||
|
|
||||||
[node name="Levels" type="Node" parent="."]
|
[node name="Levels" type="Node" parent="."]
|
||||||
|
|
||||||
[node name="Demo" parent="Levels" instance=ExtResource("1_356j3")]
|
|
||||||
|
|
||||||
[node name="StartMenu" type="Control" parent="."]
|
|
||||||
layout_mode = 3
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="StartMenu"]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
color = Color(0.522749, 0.477374, 0.510111, 0.501961)
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="StartMenu"]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
|
|
||||||
[node name="Presentation" type="MarginContainer" parent="StartMenu/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_vertical = 3
|
|
||||||
theme_override_constants/margin_left = 20
|
|
||||||
theme_override_constants/margin_top = 20
|
|
||||||
theme_override_constants/margin_right = 20
|
|
||||||
theme_override_constants/margin_bottom = 20
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="StartMenu/VBoxContainer/Presentation"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Title" type="Label" parent="StartMenu/VBoxContainer/Presentation/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "DreamBall"
|
|
||||||
label_settings = SubResource("LabelSettings_0jegv")
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="Title2" type="Label" parent="StartMenu/VBoxContainer/Presentation/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "A game about changing gravity to make a ball fly through the air"
|
|
||||||
label_settings = SubResource("LabelSettings_nbp4i")
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="StartMenu/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_vertical = 3
|
|
||||||
theme_override_constants/margin_left = 20
|
|
||||||
theme_override_constants/margin_top = 20
|
|
||||||
theme_override_constants/margin_right = 20
|
|
||||||
theme_override_constants/margin_bottom = 20
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="StartMenu/VBoxContainer/MarginContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_vertical = 3
|
|
||||||
|
|
||||||
[node name="Rules" type="VBoxContainer" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
alignment = 2
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Rules"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "- Change the direction of the gravity with the ARROW KEYS"
|
|
||||||
|
|
||||||
[node name="Label2" type="Label" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Rules"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "- Keep LEFT SHIFT pressed to make the gravity stronger"
|
|
||||||
|
|
||||||
[node name="Label3" type="Label" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Rules"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "- Press ESCAPE to pause and unpause the game at any point"
|
|
||||||
|
|
||||||
[node name="Label4" type="Label" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Rules"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "- Press R to restart the current level from the beginning
|
|
||||||
(note that it won't reset the timer!)"
|
|
||||||
|
|
||||||
[node name="Buttons" type="VBoxContainer" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
alignment = 2
|
|
||||||
|
|
||||||
[node name="Label5" type="Label" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Buttons"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Do your best to make the ball go through all the rings!"
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Buttons"]
|
|
||||||
layout_mode = 2
|
|
||||||
theme_override_constants/separation = 20
|
|
||||||
alignment = 1
|
|
||||||
|
|
||||||
[node name="Btn_Fullscreen" type="Button" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Buttons/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
action_mode = 0
|
|
||||||
text = "Toggle FULLSCREEN"
|
|
||||||
|
|
||||||
[node name="Btn_Start" type="Button" parent="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Buttons/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 4
|
|
||||||
text = "START the game!"
|
|
||||||
|
|
||||||
[node name="MarginContainer2" type="MarginContainer" parent="StartMenu/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
theme_override_constants/margin_left = 20
|
|
||||||
theme_override_constants/margin_top = 20
|
|
||||||
theme_override_constants/margin_right = 20
|
|
||||||
theme_override_constants/margin_bottom = 20
|
|
||||||
|
|
||||||
[node name="Notice" type="Label" parent="StartMenu/VBoxContainer/MarginContainer2"]
|
|
||||||
layout_mode = 2
|
|
||||||
label_settings = SubResource("LabelSettings_5jdmh")
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="StartMenu"]
|
|
||||||
libraries = {
|
|
||||||
&"": SubResource("AnimationLibrary_5cb2g")
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="PauseMenu" type="Control" parent="."]
|
[node name="PauseMenu" type="Control" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
z_index = 2
|
z_index = 2
|
||||||
|
@ -472,9 +287,16 @@ layout_mode = 2
|
||||||
size_flags_vertical = 6
|
size_flags_vertical = 6
|
||||||
text = "QUIT game"
|
text = "QUIT game"
|
||||||
|
|
||||||
[connection signal="pressed" from="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Buttons/HBoxContainer/Btn_Fullscreen" to="." method="fullscreen_game"]
|
[node name="DevInfos" type="Label" parent="."]
|
||||||
[connection signal="pressed" from="StartMenu/VBoxContainer/MarginContainer/HBoxContainer/Buttons/HBoxContainer/Btn_Start" to="." method="_on_btn_start_pressed"]
|
anchors_preset = 12
|
||||||
[connection signal="animation_finished" from="StartMenu/AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
|
anchor_top = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_top = -23.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 0
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[connection signal="pressed" from="PauseMenu/VBoxContainer/Btn_Resume" to="." method="pause_game"]
|
[connection signal="pressed" from="PauseMenu/VBoxContainer/Btn_Resume" to="." method="pause_game"]
|
||||||
[connection signal="pressed" from="PauseMenu/VBoxContainer/Btn_Fullscreen2" to="." method="fullscreen_game"]
|
[connection signal="pressed" from="PauseMenu/VBoxContainer/Btn_Fullscreen2" to="." method="fullscreen_game"]
|
||||||
[connection signal="pressed" from="PauseMenu/VBoxContainer/Btn_Restart" to="." method="restart_level"]
|
[connection signal="pressed" from="PauseMenu/VBoxContainer/Btn_Restart" to="." method="restart_level"]
|
||||||
|
|
|
@ -1,37 +1,45 @@
|
||||||
[gd_scene load_steps=7 format=3 uid="uid://ikeidrgprk8k"]
|
[gd_scene load_steps=10 format=3 uid="uid://ikeidrgprk8k"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://wlhsarkeqe8r" path="res://menus/main/panel.tscn" id="1_qfa5o"]
|
[ext_resource type="PackedScene" uid="uid://wlhsarkeqe8r" path="res://menus/main/panel.tscn" id="1_qfa5o"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cnnvwotv33u1b" path="res://elements/player.tscn" id="2_0jxef"]
|
||||||
|
|
||||||
[sub_resource type="GDScript" id="GDScript_bt14i"]
|
[sub_resource type="GDScript" id="GDScript_bt14i"]
|
||||||
script/source = "extends Node3D
|
script/source = "extends Node3D
|
||||||
|
|
||||||
|
signal request_start
|
||||||
|
|
||||||
var start_menu = preload(\"res://menus/main/start_menu.tscn\")
|
var start_menu = preload(\"res://menus/main/start_menu.tscn\")
|
||||||
var save_file_manager = preload(\"res://menus/main/save_file_manager.tscn\")
|
var save_file_manager = preload(\"res://menus/main/save_file_manager.tscn\")
|
||||||
var settings_menu = preload(\"res://menus/main/settings_menu.tscn\")
|
var settings_menu = preload(\"res://menus/main/settings_menu.tscn\")
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
$Menus/Panel2.connect(\"request_return\", func(): rotate_cube_to(0))
|
||||||
|
$Menus/Panel3.connect(\"request_return\", func(): rotate_cube_to(90))
|
||||||
|
$Menus/Panel4.connect(\"request_return\", func(): rotate_cube_to(180))
|
||||||
|
|
||||||
var sm = start_menu.instantiate()
|
var sm = start_menu.instantiate()
|
||||||
sm.connect(\"request_start\", start)
|
sm.connect(\"request_start\", start)
|
||||||
sm.connect(\"request_settings\", settings)
|
sm.connect(\"request_settings\", settings)
|
||||||
$Menus/Panel1.change_menu(sm)
|
$Menus/Panel1.change_menu(sm, false)
|
||||||
|
|
||||||
func start() -> void:
|
func start() -> void:
|
||||||
var svm = save_file_manager.instantiate()
|
request_start.emit()
|
||||||
$Menus/Panel2.change_menu(svm)
|
#var svm = save_file_manager.instantiate()
|
||||||
rotate_cube(90)
|
#$Menus/Panel2.change_menu(svm)
|
||||||
|
#rotate_cube_to(90)
|
||||||
|
|
||||||
func settings() -> void:
|
func settings() -> void:
|
||||||
var sm = settings_menu.instantiate()
|
var sm = settings_menu.instantiate()
|
||||||
$Menus/Panel2.change_menu(sm)
|
$Menus/Panel2.change_menu(sm)
|
||||||
rotate_cube(90)
|
rotate_cube_to(90)
|
||||||
|
|
||||||
func rotate_cube(degrees: int) -> void:
|
func rotate_cube_to(degrees: int) -> void:
|
||||||
if $Menus/AnimationPlayer.is_playing():
|
if $Menus/AnimationPlayer.is_playing():
|
||||||
return
|
return
|
||||||
degrees = -degrees
|
degrees = -degrees
|
||||||
|
|
||||||
var animation: Animation = $Menus/AnimationPlayer.get_animation(\"rotate\")
|
var animation: Animation = $Menus/AnimationPlayer.get_animation(\"rotate\")
|
||||||
var new_rotation = $Menus.rotation_degrees + Vector3(0, degrees, 0)
|
var new_rotation = Vector3(0, degrees, 0)
|
||||||
animation.track_set_key_value(0, 0, $Menus.rotation_degrees)
|
animation.track_set_key_value(0, 0, $Menus.rotation_degrees)
|
||||||
animation.track_set_key_value(0, 1, new_rotation)
|
animation.track_set_key_value(0, 1, new_rotation)
|
||||||
|
|
||||||
|
@ -76,18 +84,26 @@ _data = {
|
||||||
&"rotate": SubResource("Animation_bt14i")
|
&"rotate": SubResource("Animation_bt14i")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_bt14i"]
|
||||||
|
ground_color = Color(0.794232, 0.673177, 0.531056, 1)
|
||||||
|
|
||||||
|
[sub_resource type="Sky" id="Sky_0jxef"]
|
||||||
|
sky_material = SubResource("PhysicalSkyMaterial_bt14i")
|
||||||
|
|
||||||
[sub_resource type="Environment" id="Environment_qfa5o"]
|
[sub_resource type="Environment" id="Environment_qfa5o"]
|
||||||
background_mode = 1
|
background_mode = 2
|
||||||
background_color = Color(0.804743, 0.804743, 0.804743, 1)
|
background_color = Color(0.804743, 0.804743, 0.804743, 1)
|
||||||
|
sky = SubResource("Sky_0jxef")
|
||||||
|
ambient_light_source = 3
|
||||||
|
ambient_light_color = Color(0.986752, 0.986752, 0.986752, 1)
|
||||||
|
reflected_light_source = 2
|
||||||
|
|
||||||
[node name="Area" type="Node3D"]
|
[node name="Area" type="Node3D"]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
script = SubResource("GDScript_bt14i")
|
script = SubResource("GDScript_bt14i")
|
||||||
|
|
||||||
[node name="SpotLight3D" type="SpotLight3D" parent="."]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 1.90692, 0)
|
|
||||||
|
|
||||||
[node name="Menus" type="CSGBox3D" parent="."]
|
[node name="Menus" type="CSGBox3D" parent="."]
|
||||||
|
use_collision = true
|
||||||
|
|
||||||
[node name="Panel1" parent="Menus" instance=ExtResource("1_qfa5o")]
|
[node name="Panel1" parent="Menus" instance=ExtResource("1_qfa5o")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.501)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.501)
|
||||||
|
@ -107,7 +123,24 @@ libraries = {
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="Camera3D" type="Camera3D" parent="."]
|
[node name="Camera3D" type="Camera3D" parent="."]
|
||||||
transform = Transform3D(0.975535, 0, 0.219846, 0, 1, 0, -0.219846, 0, 0.975535, 0.86618, 0.217345, 1.76032)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.5)
|
||||||
|
current = true
|
||||||
|
fov = 40.0
|
||||||
|
|
||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
environment = SubResource("Environment_qfa5o")
|
environment = SubResource("Environment_qfa5o")
|
||||||
|
|
||||||
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||||
|
transform = Transform3D(0.819152, -0.412596, 0.39844, 0, 0.694658, 0.71934, -0.573576, -0.589249, 0.569031, 0, 0, 0)
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("2_0jxef")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.87335, 0)
|
||||||
|
|
||||||
|
[node name="Camera" parent="Player" index="0"]
|
||||||
|
visible = false
|
||||||
|
current = false
|
||||||
|
|
||||||
|
[node name="GPUParticles3D" parent="Player/Sphere" index="2"]
|
||||||
|
visible = false
|
||||||
|
|
||||||
|
[editable path="Player"]
|
||||||
|
|
|
@ -73,8 +73,11 @@ func _mouse_input_event(_camera: Camera3D, event: InputEvent, event_position: Ve
|
||||||
|
|
||||||
# original code
|
# original code
|
||||||
|
|
||||||
func change_menu(new_menu: Control):
|
signal request_return
|
||||||
$SubViewport/Menu.add(new_menu)
|
|
||||||
|
func change_menu(new_menu: Control, return_button: bool = true):
|
||||||
|
$SubViewport/Menu.add(new_menu, return_button)
|
||||||
|
$SubViewport/Menu.connect(\"disabled\", func(): request_return.emit())
|
||||||
"
|
"
|
||||||
|
|
||||||
[sub_resource type="QuadMesh" id="QuadMesh_gfsnp"]
|
[sub_resource type="QuadMesh" id="QuadMesh_gfsnp"]
|
||||||
|
@ -85,7 +88,6 @@ viewport_path = NodePath("SubViewport")
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_a5lkq"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_a5lkq"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
transparency = 1
|
transparency = 1
|
||||||
shading_mode = 0
|
|
||||||
albedo_texture = SubResource("ViewportTexture_gfsnp")
|
albedo_texture = SubResource("ViewportTexture_gfsnp")
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_gfsnp"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_gfsnp"]
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
[sub_resource type="GDScript" id="GDScript_18a3y"]
|
[sub_resource type="GDScript" id="GDScript_18a3y"]
|
||||||
script/source = "extends MarginContainer
|
script/source = "extends MarginContainer
|
||||||
|
|
||||||
func add(node: Control):
|
signal disabled
|
||||||
|
|
||||||
|
func add(node: Control, return_button: bool):
|
||||||
var add_to := $VSplitContainer/MarginContainer/ColorRect
|
var add_to := $VSplitContainer/MarginContainer/ColorRect
|
||||||
var children := add_to.get_children(true)
|
var children := add_to.get_children(true)
|
||||||
for child in children:
|
for child in children:
|
||||||
|
@ -16,8 +18,18 @@ func add(node: Control):
|
||||||
add_to.add_child(node)
|
add_to.add_child(node)
|
||||||
$VSplitContainer/AnimationPlayer.play(\"split_offset\")
|
$VSplitContainer/AnimationPlayer.play(\"split_offset\")
|
||||||
|
|
||||||
#await get_tree().create_timer(3.0).timeout
|
if return_button:
|
||||||
#$VSplitContainer/AnimationPlayer.play_backwards(\"split_offset\")
|
var button = Button.new()
|
||||||
|
button.text = \"Return\"
|
||||||
|
button.anchor_top = 1.0
|
||||||
|
button.anchor_bottom = 1.0
|
||||||
|
button.grow_vertical = Control.GROW_DIRECTION_BEGIN
|
||||||
|
button.connect(\"pressed\", disable)
|
||||||
|
node.add_child(button)
|
||||||
|
|
||||||
|
func disable():
|
||||||
|
$VSplitContainer/AnimationPlayer.play_backwards(\"split_offset\")
|
||||||
|
disabled.emit()
|
||||||
"
|
"
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_y8e4h"]
|
[sub_resource type="Animation" id="Animation_y8e4h"]
|
||||||
|
|
|
@ -13,7 +13,7 @@ config_version=5
|
||||||
config/name="DreamBall"
|
config/name="DreamBall"
|
||||||
config/description="Manipulate the gravity to make a ball go through every ring!
|
config/description="Manipulate the gravity to make a ball go through every ring!
|
||||||
https://kitsunes.dev/Taevas/DreamBall"
|
https://kitsunes.dev/Taevas/DreamBall"
|
||||||
config/version="20250326.0"
|
config/version="20250330.0"
|
||||||
run/main_scene="res://index.tscn"
|
run/main_scene="res://index.tscn"
|
||||||
config/features=PackedStringArray("4.4", "GL Compatibility")
|
config/features=PackedStringArray("4.4", "GL Compatibility")
|
||||||
boot_splash/show_image=false
|
boot_splash/show_image=false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue