menu et +

This commit is contained in:
2024-10-19 20:22:03 +02:00
parent 360a866db9
commit 1bca0ada4f
12 changed files with 345 additions and 26 deletions

34
model/Adult.png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bd7mgb8te607q"
path="res://.godot/imported/Adult.png-0155ce54d1473f5b9d0f6dee62bdcaff.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://model/Adult.png"
dest_files=["res://.godot/imported/Adult.png-0155ce54d1473f5b9d0f6dee62bdcaff.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

34
model/Credit.png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cf12hst5y4gfr"
path="res://.godot/imported/Credit.png-436b40945aa80484adf971d289102556.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://model/Credit.png"
dest_files=["res://.godot/imported/Credit.png-436b40945aa80484adf971d289102556.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

34
model/Kid1.png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://gnnvs3vb6gbp"
path="res://.godot/imported/Kid1.png-8628474eb807d2fe44ef4034766de500.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://model/Kid1.png"
dest_files=["res://.godot/imported/Kid1.png-8628474eb807d2fe44ef4034766de500.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

34
model/Kid2.png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cg85fp8qcu5hj"
path="res://.godot/imported/Kid2.png-416226bcee998ad32078f3f77da3433c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://model/Kid2.png"
dest_files=["res://.godot/imported/Kid2.png-416226bcee998ad32078f3f77da3433c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -11,7 +11,7 @@ config_version=5
[application] [application]
config/name="Mal-Adresse" config/name="Mal-Adresse"
run/main_scene="res://scene/city.tscn" run/main_scene="res://scene/principal.tscn"
config/features=PackedStringArray("4.3", "C#", "Forward Plus") config/features=PackedStringArray("4.3", "C#", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3 uid="uid://co0u7xd45nxv1"] [gd_scene load_steps=8 format=3 uid="uid://co0u7xd45nxv1"]
[ext_resource type="FontFile" uid="uid://c0i81edd5mitx" path="res://font/October Crow.ttf" id="1_ndt1a"] [ext_resource type="FontFile" uid="uid://c0i81edd5mitx" path="res://font/October Crow.ttf" id="1_ndt1a"]
[ext_resource type="Script" path="res://script/Menu.cs" id="1_pfhrs"] [ext_resource type="Script" path="res://script/Menu.cs" id="1_pfhrs"]
@@ -9,7 +9,9 @@
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1bsfp"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1bsfp"]
[node name="menu" type="Control"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_q8v2y"]
[node name="menu" type="Control" node_paths=PackedStringArray("pause", "trick")]
process_mode = 3 process_mode = 3
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
@@ -18,6 +20,8 @@ anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_pfhrs") script = ExtResource("1_pfhrs")
pause = NodePath("pause")
trick = NodePath("trick")
[node name="background" type="Panel" parent="."] [node name="background" type="Panel" parent="."]
layout_mode = 1 layout_mode = 1
@@ -32,13 +36,14 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_ukgpa")
position = Vector2(200, 150) position = Vector2(200, 150)
texture = ExtResource("2_e3nc5") texture = ExtResource("2_e3nc5")
[node name="Panel" type="Panel" parent="."] [node name="pause" type="Panel" parent="."]
visible = false
layout_mode = 0 layout_mode = 0
offset_right = 40.0 offset_right = 40.0
offset_bottom = 40.0 offset_bottom = 40.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_1bsfp") theme_override_styles/panel = SubResource("StyleBoxEmpty_1bsfp")
[node name="Paused" type="Label" parent="Panel"] [node name="Paused" type="Label" parent="pause"]
layout_mode = 2 layout_mode = 2
offset_left = 28.0 offset_left = 28.0
offset_top = 17.0 offset_top = 17.0
@@ -48,7 +53,7 @@ theme_override_fonts/font = ExtResource("1_ndt1a")
theme_override_font_sizes/font_size = 64 theme_override_font_sizes/font_size = 64
text = "Paused" text = "Paused"
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"] [node name="VBoxContainer" type="VBoxContainer" parent="pause"]
custom_minimum_size = Vector2(100, 0) custom_minimum_size = Vector2(100, 0)
layout_mode = 2 layout_mode = 2
offset_left = 250.0 offset_left = 250.0
@@ -59,29 +64,105 @@ size_flags_horizontal = 4
theme_override_constants/separation = 16 theme_override_constants/separation = 16
alignment = 1 alignment = 1
[node name="Resume" type="Button" parent="Panel/VBoxContainer"] [node name="Resume" type="Button" parent="pause/VBoxContainer"]
layout_mode = 2 layout_mode = 2
theme = ExtResource("2_166c6") theme = ExtResource("2_166c6")
text = "Resume text = "Resume
" "
[node name="Trick" type="Button" parent="Panel/VBoxContainer"] [node name="Trick" type="Button" parent="pause/VBoxContainer"]
layout_mode = 2 layout_mode = 2
theme = ExtResource("2_166c6") theme = ExtResource("2_166c6")
text = "Trick text = "Trick
" "
[node name="exit" type="Button" parent="Panel/VBoxContainer"] [node name="exit" type="Button" parent="pause/VBoxContainer"]
layout_mode = 2 layout_mode = 2
theme = ExtResource("2_166c6") theme = ExtResource("2_166c6")
text = "Exit text = "Exit
" "
[node name="TrickMenu" type="Control" parent="."] [node name="trick" type="Panel" parent="."]
anchors_preset = 0 layout_mode = 1
offset_right = 40.0 pivot_offset = Vector2(-200, -150)
offset_bottom = 40.0 theme_override_styles/panel = SubResource("StyleBoxEmpty_q8v2y")
[connection signal="button_down" from="Panel/VBoxContainer/Resume" to="." method="ResumeDown"] [node name="GridContainer" type="GridContainer" parent="trick"]
[connection signal="button_down" from="Panel/VBoxContainer/Trick" to="." method="OptionDown"] layout_direction = 2
[connection signal="button_down" from="Panel/VBoxContainer/exit" to="." method="ExitDown"] layout_mode = 1
anchors_preset = 13
anchor_left = 0.5
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = 110.0
offset_top = 30.0
offset_right = 283.0
offset_bottom = 246.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/h_separation = 15
theme_override_constants/v_separation = 20
columns = 2
[node name="Label" type="Label" parent="trick/GridContainer"]
layout_mode = 2
theme = ExtResource("2_166c6")
theme_override_font_sizes/font_size = 36
text = "speel"
[node name="Label2" type="Label" parent="trick/GridContainer"]
layout_mode = 2
theme = ExtResource("2_166c6")
theme_override_font_sizes/font_size = 36
text = "speel"
[node name="Label3" type="Label" parent="trick/GridContainer"]
layout_mode = 2
theme = ExtResource("2_166c6")
theme_override_font_sizes/font_size = 36
text = "speel"
[node name="Label4" type="Label" parent="trick/GridContainer"]
layout_mode = 2
theme = ExtResource("2_166c6")
theme_override_font_sizes/font_size = 36
text = "speel"
[node name="Label5" type="Label" parent="trick/GridContainer"]
layout_mode = 2
theme = ExtResource("2_166c6")
theme_override_font_sizes/font_size = 36
text = "speel"
[node name="Label6" type="Label" parent="trick/GridContainer"]
layout_mode = 2
theme = ExtResource("2_166c6")
theme_override_font_sizes/font_size = 36
text = "speel"
[node name="Label7" type="Label" parent="trick/GridContainer"]
layout_mode = 2
theme = ExtResource("2_166c6")
theme_override_font_sizes/font_size = 36
text = "speel"
[node name="Label8" type="Label" parent="trick/GridContainer"]
layout_mode = 2
theme = ExtResource("2_166c6")
theme_override_font_sizes/font_size = 36
text = "speel"
[node name="exit" type="Button" parent="trick"]
layout_mode = 0
offset_left = 22.0
offset_top = 246.0
offset_right = 74.0
offset_bottom = 284.0
theme = ExtResource("2_166c6")
text = "Exit
"
[connection signal="button_down" from="pause/VBoxContainer/Resume" to="." method="ResumeDown"]
[connection signal="button_down" from="pause/VBoxContainer/Trick" to="." method="OptionDown"]
[connection signal="button_down" from="pause/VBoxContainer/exit" to="." method="ExitDown"]
[connection signal="pressed" from="trick/exit" to="." method="ExitTrick"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=33 format=3 uid="uid://4ubk6w44h4s2"] [gd_scene load_steps=34 format=3 uid="uid://4ubk6w44h4s2"]
[ext_resource type="Script" path="res://script/Player.cs" id="1_gmlsd"] [ext_resource type="Script" path="res://script/Player.cs" id="1_gmlsd"]
[ext_resource type="Texture2D" uid="uid://bo4q2rvn056p3" path="res://model/PatrickIdle1.png" id="2_w2lj6"] [ext_resource type="Texture2D" uid="uid://bo4q2rvn056p3" path="res://model/PatrickIdle1.png" id="2_w2lj6"]
@@ -10,6 +10,7 @@
[ext_resource type="Texture2D" uid="uid://b5mfnew4kh6ht" path="res://model/PatrickLeft1.png" id="5_vnnjt"] [ext_resource type="Texture2D" uid="uid://b5mfnew4kh6ht" path="res://model/PatrickLeft1.png" id="5_vnnjt"]
[ext_resource type="Texture2D" uid="uid://dyi5a1hlwio71" path="res://model/Glitch4.png" id="6_73f32"] [ext_resource type="Texture2D" uid="uid://dyi5a1hlwio71" path="res://model/Glitch4.png" id="6_73f32"]
[ext_resource type="Texture2D" uid="uid://bu5nnr2x4co38" path="res://model/PatrickLeft2.png" id="6_jii6b"] [ext_resource type="Texture2D" uid="uid://bu5nnr2x4co38" path="res://model/PatrickLeft2.png" id="6_jii6b"]
[ext_resource type="PackedScene" uid="uid://cru3yl7laeiem" path="res://scene/principal.tscn" id="6_plp4a"]
[ext_resource type="Texture2D" uid="uid://doavv8drnetm" path="res://model/PatrickRight1.png" id="7_xptin"] [ext_resource type="Texture2D" uid="uid://doavv8drnetm" path="res://model/PatrickRight1.png" id="7_xptin"]
[ext_resource type="Texture2D" uid="uid://dbey2oeyhxsq8" path="res://model/PatrickRight2.png" id="8_m32jm"] [ext_resource type="Texture2D" uid="uid://dbey2oeyhxsq8" path="res://model/PatrickRight2.png" id="8_m32jm"]
[ext_resource type="Texture2D" uid="uid://dxepey1fkkhhv" path="res://model/DiabeteMeter1.png" id="9_0ohl3"] [ext_resource type="Texture2D" uid="uid://dxepey1fkkhhv" path="res://model/DiabeteMeter1.png" id="9_0ohl3"]
@@ -406,6 +407,7 @@ offset_right = -47.0
offset_bottom = -60.0 offset_bottom = -60.0
scale = Vector2(0.334, 0.334) scale = Vector2(0.334, 0.334)
anim = NodePath("../../anim") anim = NodePath("../../anim")
principal = ExtResource("6_plp4a")
[node name="door_view" parent="Camera2D" instance=ExtResource("4_0vwed")] [node name="door_view" parent="Camera2D" instance=ExtResource("4_0vwed")]
visible = false visible = false

View File

@@ -1,14 +1,19 @@
[gd_scene load_steps=6 format=3 uid="uid://cru3yl7laeiem"] [gd_scene load_steps=9 format=3 uid="uid://cru3yl7laeiem"]
[ext_resource type="Texture2D" uid="uid://mr6hi8icwyle" path="res://model/Trick or treatBG.png" id="1_4oira"] [ext_resource type="Texture2D" uid="uid://mr6hi8icwyle" path="res://model/Trick or treatBG.png" id="1_4oira"]
[ext_resource type="Script" path="res://script/Principal.cs" id="1_5hpqm"] [ext_resource type="Script" path="res://script/Principal.cs" id="1_5hpqm"]
[ext_resource type="Theme" uid="uid://depo4fa5p8k8m" path="res://themes/button.tres" id="2_ab0tu"] [ext_resource type="Theme" uid="uid://depo4fa5p8k8m" path="res://themes/button.tres" id="2_ab0tu"]
[ext_resource type="PackedScene" uid="uid://1tfopbwug3ht" path="res://scene/city.tscn" id="2_qp7s0"] [ext_resource type="PackedScene" uid="uid://1tfopbwug3ht" path="res://scene/city.tscn" id="2_qp7s0"]
[ext_resource type="StyleBox" uid="uid://cl1mx7tnohwg6" path="res://themes/back_principal.tres" id="5_tyto3"]
[ext_resource type="Texture2D" uid="uid://cf12hst5y4gfr" path="res://model/Credit.png" id="6_px85q"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qdt6c"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8wh7p"]
bg_color = Color(0, 0, 0, 0.792157) bg_color = Color(0.0728426, 0.0728426, 0.0728426, 0.890196)
[node name="Principal" type="Control" node_paths=PackedStringArray("sub")] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kg8au"]
bg_color = Color(0.0728426, 0.0728426, 0.0728426, 0.890196)
[node name="Principal" type="Control" node_paths=PackedStringArray("sub", "credit")]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@@ -17,6 +22,7 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_5hpqm") script = ExtResource("1_5hpqm")
sub = NodePath("sub") sub = NodePath("sub")
credit = NodePath("credit")
play = ExtResource("2_qp7s0") play = ExtResource("2_qp7s0")
[node name="TrickOrTreatBg" type="Sprite2D" parent="."] [node name="TrickOrTreatBg" type="Sprite2D" parent="."]
@@ -41,7 +47,7 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_qdt6c") theme_override_styles/panel = ExtResource("5_tyto3")
[node name="Play" type="Button" parent="sub"] [node name="Play" type="Button" parent="sub"]
layout_mode = 0 layout_mode = 0
@@ -72,4 +78,60 @@ theme = ExtResource("2_ab0tu")
text = "Exit text = "Exit
" "
[node name="credit" type="Panel" parent="."]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = ExtResource("5_tyto3")
[node name="Credit" type="Sprite2D" parent="credit"]
texture = ExtResource("6_px85q")
centered = false
[node name="Label" type="Label" parent="credit"]
layout_mode = 0
offset_left = 13.0
offset_top = 248.0
offset_right = 207.0
offset_bottom = 293.0
theme = ExtResource("2_ab0tu")
theme_override_font_sizes/font_size = 38
theme_override_styles/normal = SubResource("StyleBoxFlat_8wh7p")
text = "Programming
"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label2" type="Label" parent="credit"]
layout_mode = 0
offset_left = 322.0
offset_top = 252.0
offset_right = 386.0
offset_bottom = 296.0
theme = ExtResource("2_ab0tu")
theme_override_font_sizes/font_size = 38
theme_override_styles/normal = SubResource("StyleBoxFlat_kg8au")
text = "Art
"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Button" type="Button" parent="credit"]
layout_mode = 0
offset_left = 163.0
offset_top = 15.0
offset_right = 215.0
offset_bottom = 53.0
theme = ExtResource("2_ab0tu")
text = "Exit
"
[connection signal="pressed" from="Enter" to="." method="EnterPressed"] [connection signal="pressed" from="Enter" to="." method="EnterPressed"]
[connection signal="pressed" from="sub/Play" to="." method="PlayPressed"]
[connection signal="pressed" from="sub/Credits" to="." method="creditEnter"]
[connection signal="pressed" from="sub/Exit" to="." method="ExitGlobPressed"]
[connection signal="pressed" from="credit/Button" to="." method="CreditExit"]

View File

@@ -4,6 +4,9 @@ using System;
public partial class Menu : Control public partial class Menu : Control
{ {
[Export] AnimationPlayer anim; [Export] AnimationPlayer anim;
[Export] Panel pause;
[Export] Panel trick;
[Export] PackedScene principal;
// Called when the node enters the scene tree for the first time. // Called when the node enters the scene tree for the first time.
public override void _Ready() public override void _Ready()
{ {
@@ -23,16 +26,23 @@ public partial class Menu : Control
public void OptionDown() public void OptionDown()
{ {
pause.Visible = false;
trick.Visible = true;
} }
public void ExitDown() public void ExitDown()
{ {
GetTree().Quit(); GetTree().ChangeSceneToPacked(principal);
} }
public void Res() public void Res()
{ {
GetTree().Paused = false; GetTree().Paused = false;
} }
public void ExitTrick()
{
pause.Visible = true;
trick.Visible = false;
}
} }

View File

@@ -10,6 +10,7 @@ public partial class Player : CharacterBody2D
[Export] TextureProgressBar bar; [Export] TextureProgressBar bar;
[ExportGroup("controls")] [ExportGroup("controls")]
[Export] Control menu; [Export] Control menu;
[Export] PackedScene principal;

View File

@@ -4,8 +4,9 @@ using System;
public partial class Principal : Control public partial class Principal : Control
{ {
[Export] Panel sub; [Export] Panel sub;
[Export] Panel credit;
[Export] PackedScene play; [Export] PackedScene play;
[Export] PackedScene credit;
// Called when the node enters the scene tree for the first time. // Called when the node enters the scene tree for the first time.
public override void _Ready() public override void _Ready()
{ {
@@ -21,4 +22,26 @@ public partial class Principal : Control
{ {
sub.Visible = true; sub.Visible = true;
} }
public void creditEnter()
{
credit.Visible = true;
sub.Visible = false;
}
public void CreditExit()
{
credit.Visible = false;
sub.Visible = true;
}
public void PlayPressed()
{
GetTree().ChangeSceneToPacked(play);
}
public void ExitGlobPressed()
{
GetTree().Quit();
}
} }

View File

@@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://cl1mx7tnohwg6"]
[resource]
bg_color = Color(0, 0, 0, 0.792157)