Adding menu

This commit is contained in:
Zacharie Guet 2024-09-01 16:19:47 +02:00
parent 510e96cde6
commit 67d7812205
3 changed files with 258 additions and 0 deletions

252
Menu.tscn Normal file
View File

@ -0,0 +1,252 @@
[gd_scene load_steps=17 format=3 uid="uid://b56357feudy7x"]
[ext_resource type="Script" path="res://scripts/gui/menu.gd" id="1_88exu"]
[ext_resource type="Texture2D" uid="uid://bkwi6yurko7gm" path="res://assets/texture/sol_gamejam_fleurs.png" id="1_t32ec"]
[ext_resource type="Texture2D" uid="uid://24ift4wt1h2h" path="res://assets/plants/evolution2.1.png" id="2_b6wtb"]
[ext_resource type="Texture2D" uid="uid://cxbv1inffa2bq" path="res://assets/plants/abre1.png" id="3_xkq6i"]
[ext_resource type="Texture2D" uid="uid://34v3ub405uwp" path="res://assets/plants/evolution2.3.png" id="4_4gpyw"]
[ext_resource type="Texture2D" uid="uid://damy6xcp3jd0s" path="res://assets/plants/herbe1.png" id="5_ismvq"]
[ext_resource type="Texture2D" uid="uid://be2g1u7d8lwc8" path="res://assets/plants/herbe4.png" id="6_4qsad"]
[ext_resource type="Texture2D" uid="uid://b8rmpitmxeobx" path="res://assets/plants/herbe8.png" id="7_xxlvc"]
[ext_resource type="Theme" uid="uid://dnebunkx13tbr" path="res://assets/gui/Text.tres" id="8_h7a3q"]
[sub_resource type="Gradient" id="Gradient_ybrxb"]
offsets = PackedFloat32Array(0, 0.446746, 1)
colors = PackedColorArray(0.82616, 0.5888, 0.92, 1, 0.6035, 0.784267, 0.85, 0.964706, 0.1472, 0.92, 0.70104, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_h0k83"]
gradient = SubResource("Gradient_ybrxb")
fill = 1
fill_from = Vector2(0.5, 0.491453)
fill_to = Vector2(0.538462, 0.175214)
[sub_resource type="Animation" id="Animation_y1bjl"]
resource_name = "Fées"
length = 4.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Fée:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.9, 1.76667, 2.56667, 3.53333),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 0,
"values": [Vector2(717, 330), Vector2(772, 366), Vector2(773, 304), Vector2(665, 277), Vector2(695.54, 308.127)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Fée2:position")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.233333, 1.03333, 1.93333, 3.1),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(764, 229), Vector2(721, 211), Vector2(694, 218), Vector2(711, 240)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Fée3:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.5, 1.46667, 2.63333, 3.66667),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(933.621, 317.621), Vector2(884, 300), Vector2(879, 343), Vector2(921, 346)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("MarginContainer/VBoxContainer/ClickToPlay:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.766667, 1.66667, 2.73333),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0.227451), Color(1, 1, 1, 1), Color(1, 1, 1, 0.227451)]
}
[sub_resource type="Animation" id="Animation_tx45x"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Fée:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(717, 330)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Fée2:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(764, 229)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Fée3:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(933.621, 317.621)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("MarginContainer/VBoxContainer/ClickToPlay:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_umps0"]
_data = {
"Fées": SubResource("Animation_y1bjl"),
"RESET": SubResource("Animation_tx45x")
}
[sub_resource type="LabelSettings" id="LabelSettings_0qv27"]
line_spacing = -50.0
font_size = 100
[sub_resource type="LabelSettings" id="LabelSettings_7b0ti"]
font_size = 31
font_color = Color(0.882353, 0.6, 0.145098, 1)
[node name="Menu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_88exu")
[node name="Fond" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("1_t32ec")
expand_mode = 2
stretch_mode = 4
[node name="Evolution2_1" type="Sprite2D" parent="."]
position = Vector2(859, 359)
scale = Vector2(0.256, 0.256)
texture = ExtResource("2_b6wtb")
[node name="Fée2" type="Sprite2D" parent="."]
position = Vector2(764, 229)
scale = Vector2(0.456177, 0.456177)
texture = SubResource("GradientTexture2D_h0k83")
[node name="Abre1" type="Sprite2D" parent="."]
position = Vector2(766, 286)
scale = Vector2(0.385833, 0.385833)
texture = ExtResource("3_xkq6i")
[node name="Evolution2_3" type="Sprite2D" parent="."]
position = Vector2(570, 485)
scale = Vector2(0.242, 0.242)
texture = ExtResource("4_4gpyw")
[node name="Herbe1" type="Sprite2D" parent="."]
position = Vector2(876.5, 498.5)
scale = Vector2(0.275, 0.275)
texture = ExtResource("5_ismvq")
[node name="Herbe4" type="Sprite2D" parent="."]
position = Vector2(593, 364)
scale = Vector2(0.1525, 0.1525)
texture = ExtResource("6_4qsad")
[node name="Herbe8" type="Sprite2D" parent="."]
position = Vector2(798, 528)
scale = Vector2(0.2125, 0.2125)
texture = ExtResource("7_xxlvc")
[node name="Fée" type="Sprite2D" parent="."]
position = Vector2(717, 330)
scale = Vector2(0.765625, 0.765625)
texture = SubResource("GradientTexture2D_h0k83")
[node name="Fée3" type="Sprite2D" parent="."]
position = Vector2(933.621, 317.621)
scale = Vector2(0.449341, 0.449341)
texture = SubResource("GradientTexture2D_h0k83")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_umps0")
}
autoplay = "Fées"
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 50
theme_override_constants/margin_right = 50
theme_override_constants/margin_bottom = 50
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="Titre" type="Label" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
theme = ExtResource("8_h7a3q")
text = "Seeding the
Wasteland"
label_settings = SubResource("LabelSettings_0qv27")
[node name="ClickToPlay" type="Label" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
theme = ExtResource("8_h7a3q")
text = "Click to Play"
label_settings = SubResource("LabelSettings_7b0ti")
[node name="Credits" type="Label" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
theme = ExtResource("8_h7a3q")
text = "Art : Lunarde and Mimilefleury
Development/GD : Zink and Altaezio
Music : Nilou"

5
scripts/gui/menu.gd Normal file
View File

@ -0,0 +1,5 @@
extends Control
func _input(event):
if event.is_action_pressed("plant"):
get_tree().change_scene_to_file("res://Game.tscn")

View File

@ -171,6 +171,7 @@ func generate_noise() -> Noise:
noise.seed = randi()
noise.fractal_lacunarity = 1
noise.frequency = 0.005
noise.fractal_gain = 1000
return noise