diff --git a/README.md b/README.md index 47256b1..e83e064 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Game -失神 \ No newline at end of file +失神 diff --git a/components/Abstracts/BaseMenu.tscn b/components/Abstracts/BaseMenu.tscn new file mode 100644 index 0000000..c4d4b78 --- /dev/null +++ b/components/Abstracts/BaseMenu.tscn @@ -0,0 +1,32 @@ +[gd_scene format=3 uid="uid://cpaa0vcxwar3i"] + +[ext_resource type="Script" uid="uid://bd1nba4oijmgp" path="res://scripts/Statemachine/Abstract/BaseMenu.gd" id="1_x5ano"] + +[node name="Menu" type="Control" unique_id=1823905463] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_x5ano") + +[node name="animator" type="AnimationPlayer" parent="." unique_id=204407114] +unique_name_in_owner = true + +[node name="background" type="ColorRect" parent="." unique_id=1236798550] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="content" type="Control" parent="." unique_id=1993984611] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 diff --git a/components/Menus/Main.tscn b/components/Menus/Main.tscn new file mode 100644 index 0000000..9278d2d --- /dev/null +++ b/components/Menus/Main.tscn @@ -0,0 +1,112 @@ +[gd_scene format=3 uid="uid://3mu73nyxqj7l"] + +[ext_resource type="PackedScene" uid="uid://cpaa0vcxwar3i" path="res://components/Abstracts/BaseMenu.tscn" id="1_2cmx8"] +[ext_resource type="VideoStream" uid="uid://cnnnx6f2j5npp" path="res://resources/animation/background.ogv" id="2_puagb"] +[ext_resource type="Texture2D" uid="uid://d2ikr66k3hpsm" path="res://resources/logo/losing-mind-invert.png" id="3_puagb"] + +[sub_resource type="Animation" id="Animation_5ifwo"] +length = 0.001 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("content/logo:offset_left") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(-100, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} +tracks/1/type = "bezier" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("content/logo:modulate:a") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"handle_modes": PackedInt32Array(0), +"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0), +"times": PackedFloat32Array(0) +} + +[sub_resource type="Animation" id="Animation_puagb"] +resource_name = "enter" +step = 0.05 +tracks/0/type = "bezier" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("content/logo:offset_left") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"handle_modes": PackedInt32Array(0, 2), +"points": PackedFloat32Array(-200, 0, 0, 0, 0, 0, -0.15, 0, 0, 0), +"times": PackedFloat32Array(0, 0.25) +} +tracks/1/type = "bezier" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("content/logo:modulate:a") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"handle_modes": PackedInt32Array(2, 2), +"points": PackedFloat32Array(0, 0, 0, 0, 0, 1, -0.15, 0, 0, 0), +"times": PackedFloat32Array(0, 0.25) +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_5ifwo"] +_data = { +&"RESET": SubResource("Animation_5ifwo"), +&"enter": SubResource("Animation_puagb") +} + +[node name="MainMenu" unique_id=1823905463 instance=ExtResource("1_2cmx8")] +backgroundColor = Color(1, 1, 1, 0) + +[node name="animator" parent="." index="0" unique_id=204407114] +libraries/ = SubResource("AnimationLibrary_5ifwo") + +[node name="background" parent="." index="1" unique_id=1236798550] +color = Color(1, 1, 1, 0) + +[node name="background" type="VideoStreamPlayer" parent="content" parent_id_path=PackedInt32Array(1993984611) index="0" unique_id=448862813] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +stream = ExtResource("2_puagb") +autoplay = true +expand = true +loop = true + +[node name="logo" type="TextureRect" parent="content" parent_id_path=PackedInt32Array(1993984611) index="1" unique_id=1126334390] +modulate = Color(1, 1, 1, 0) +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.05 +anchor_top = 0.1 +anchor_right = 0.05 +anchor_bottom = 0.1 +offset_left = -100.0 +offset_right = 592.0 +offset_bottom = 176.0 +texture = ExtResource("3_puagb") +stretch_mode = 4 + +[node name="buttons" type="VBoxContainer" parent="content" parent_id_path=PackedInt32Array(1993984611) index="2" unique_id=2029610714] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.05 +anchor_top = 0.95 +anchor_right = 0.05 +anchor_bottom = 0.95 +offset_top = -40.0 +offset_right = 40.0 +grow_vertical = 0 + +[node name="startGame" type="Button" parent="content/buttons" index="0" unique_id=1946692760] +layout_mode = 2 +text = "开始游戏" diff --git a/components/Menus/Start.tscn b/components/Menus/Start.tscn new file mode 100644 index 0000000..493a49f --- /dev/null +++ b/components/Menus/Start.tscn @@ -0,0 +1,147 @@ +[gd_scene format=3 uid="uid://drfuhbhan42q8"] + +[ext_resource type="PackedScene" uid="uid://cpaa0vcxwar3i" path="res://components/Abstracts/BaseMenu.tscn" id="1_ciyig"] +[ext_resource type="Texture2D" uid="uid://c1jdhinrkkif4" path="res://resources/logo/studio.jpg" id="2_wnodh"] +[ext_resource type="Texture2D" uid="uid://84tagbhaf8bi" path="res://resources/logo/losing-mind.png" id="3_ndv0w"] + +[sub_resource type="Animation" id="Animation_827xn"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("content/studioLogo:modulate:a") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0.0] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("content/gameLogo:modulate:a") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0.0] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".:modulate:a") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [1.0] +} + +[sub_resource type="Animation" id="Animation_bv3ut"] +resource_name = "spawn" +length = 12.0 +step = 0.1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("content/studioLogo:modulate:a") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1, 4, 5), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [0.0, 1.0, 1.0, 0.0] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("content/gameLogo:modulate:a") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 6, 7, 10, 11), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1), +"update": 0, +"values": [0.0, 0.0, 1.0, 1.0, 0.0] +} +tracks/2/type = "method" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(12), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"queue_free" +}] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath(".:modulate:a") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0, 11, 12), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [1.0, 1.0, 0.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_wnodh"] +_data = { +&"RESET": SubResource("Animation_827xn"), +&"spawn": SubResource("Animation_bv3ut") +} + +[node name="StartMenu" unique_id=1823905463 instance=ExtResource("1_ciyig")] + +[node name="animator" parent="." index="0" unique_id=204407114] +libraries/ = SubResource("AnimationLibrary_wnodh") +autoplay = &"spawn" + +[node name="background" type="ColorRect" parent="content" parent_id_path=PackedInt32Array(1993984611) index="0" unique_id=2115224193] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="studioLogo" type="TextureRect" parent="content" parent_id_path=PackedInt32Array(1993984611) index="1" unique_id=900485145] +modulate = Color(1, 1, 1, 0) +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +scale = Vector2(0.5, 0.5) +pivot_offset_ratio = Vector2(0.5, 0.5) +texture = ExtResource("2_wnodh") +expand_mode = 1 +stretch_mode = 5 + +[node name="gameLogo" type="TextureRect" parent="content" parent_id_path=PackedInt32Array(1993984611) index="2" unique_id=1468758261] +modulate = Color(1, 1, 1, 0) +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +scale = Vector2(0.5, 0.5) +pivot_offset_ratio = Vector2(0.5, 0.5) +texture = ExtResource("3_ndv0w") +expand_mode = 1 +stretch_mode = 5 diff --git a/project.godot b/project.godot index bebb7a2..b2387f0 100644 --- a/project.godot +++ b/project.godot @@ -11,9 +11,19 @@ config_version=5 [application] config/name="LosingMind" +run/main_scene="uid://blhs4mjutgugy" config/features=PackedStringArray("4.6", "GL Compatibility") config/icon="res://icon.svg" +[display] + +window/size/viewport_width=1600 +window/size/viewport_height=900 + +[gui] + +theme/custom="uid://ct2x3sobaob06" + [physics] 3d/physics_engine="Jolt Physics" diff --git a/resources/animation/background.ogv b/resources/animation/background.ogv new file mode 100644 index 0000000..2f675d3 Binary files /dev/null and b/resources/animation/background.ogv differ diff --git a/resources/animation/background.ogv.uid b/resources/animation/background.ogv.uid new file mode 100644 index 0000000..a321118 --- /dev/null +++ b/resources/animation/background.ogv.uid @@ -0,0 +1 @@ +uid://cnnnx6f2j5npp diff --git a/resources/logo/losing-mind-invert.png b/resources/logo/losing-mind-invert.png new file mode 100644 index 0000000..43cb876 Binary files /dev/null and b/resources/logo/losing-mind-invert.png differ diff --git a/resources/logo/losing-mind-invert.png.import b/resources/logo/losing-mind-invert.png.import new file mode 100644 index 0000000..ccee436 --- /dev/null +++ b/resources/logo/losing-mind-invert.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2ikr66k3hpsm" +path="res://.godot/imported/losing-mind-invert.png-9f5f8460d4f34793f4163c5977fece07.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/logo/losing-mind-invert.png" +dest_files=["res://.godot/imported/losing-mind-invert.png-9f5f8460d4f34793f4163c5977fece07.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/resources/logo/losing-mind.png b/resources/logo/losing-mind.png new file mode 100644 index 0000000..c5da499 Binary files /dev/null and b/resources/logo/losing-mind.png differ diff --git a/resources/logo/losing-mind.png.import b/resources/logo/losing-mind.png.import new file mode 100644 index 0000000..ba9b617 --- /dev/null +++ b/resources/logo/losing-mind.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://84tagbhaf8bi" +path="res://.godot/imported/losing-mind.png-b05126978a2d9c76ec2a5b42b4fffaa4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/logo/losing-mind.png" +dest_files=["res://.godot/imported/losing-mind.png-b05126978a2d9c76ec2a5b42b4fffaa4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/resources/logo/studio.jpg b/resources/logo/studio.jpg new file mode 100644 index 0000000..c50cfbc Binary files /dev/null and b/resources/logo/studio.jpg differ diff --git a/resources/logo/studio.jpg.import b/resources/logo/studio.jpg.import new file mode 100644 index 0000000..0ecb96d --- /dev/null +++ b/resources/logo/studio.jpg.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1jdhinrkkif4" +path="res://.godot/imported/studio.jpg-d2f8e7f95abea1747b1a5e900ddd163c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resources/logo/studio.jpg" +dest_files=["res://.godot/imported/studio.jpg-d2f8e7f95abea1747b1a5e900ddd163c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/scripts/Statemachine/Abstract/BaseMenu.gd b/scripts/Statemachine/Abstract/BaseMenu.gd new file mode 100644 index 0000000..c53816b --- /dev/null +++ b/scripts/Statemachine/Abstract/BaseMenu.gd @@ -0,0 +1,10 @@ +@tool +extends Control +class_name BaseMenu + +@export var backgroundColor: Color = Color.WHITE + +@onready var backgroundRect: ColorRect = $%background + +func _ready() -> void: + backgroundRect.color = backgroundColor diff --git a/scripts/Statemachine/Abstract/BaseMenu.gd.uid b/scripts/Statemachine/Abstract/BaseMenu.gd.uid new file mode 100644 index 0000000..194e1c9 --- /dev/null +++ b/scripts/Statemachine/Abstract/BaseMenu.gd.uid @@ -0,0 +1 @@ +uid://bd1nba4oijmgp diff --git a/themes/main.tres b/themes/main.tres new file mode 100644 index 0000000..bc0034d --- /dev/null +++ b/themes/main.tres @@ -0,0 +1,75 @@ +[gd_resource type="Theme" format=3 uid="uid://ct2x3sobaob06"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wc0q8"] +content_margin_left = 20.0 +content_margin_top = 10.0 +content_margin_right = 20.0 +content_margin_bottom = 10.0 +bg_color = Color(0.25, 0.25, 0.25, 1) +skew = Vector2(0.25, 0) +border_color = Color(1, 1, 1, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0avsd"] +content_margin_left = 20.0 +content_margin_top = 10.0 +content_margin_right = 20.0 +content_margin_bottom = 10.0 +bg_color = Color(0.25, 0.25, 0.25, 1) +skew = Vector2(0.25, 0) +border_width_left = 4 +border_width_top = 4 +border_width_right = 4 +border_width_bottom = 4 +border_color = Color(1, 1, 1, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wykhr"] +content_margin_left = 20.0 +content_margin_top = 10.0 +content_margin_right = 20.0 +content_margin_bottom = 10.0 +bg_color = Color(0.5, 0.5, 0.5, 1) +skew = Vector2(0.25, 0) +border_width_left = 5 +border_width_top = 5 +border_width_right = 5 +border_width_bottom = 5 +border_color = Color(1, 1, 1, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1id7b"] +content_margin_left = 20.0 +content_margin_top = 10.0 +content_margin_right = 20.0 +content_margin_bottom = 10.0 +bg_color = Color(0, 0, 0, 1) +skew = Vector2(0.25, 0) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(1, 1, 1, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_78ekx"] +content_margin_left = 20.0 +content_margin_top = 10.0 +content_margin_right = 20.0 +content_margin_bottom = 10.0 +bg_color = Color(0.5, 0.5, 0.5, 1) +skew = Vector2(0.25, 0) +border_width_left = 6 +border_width_top = 6 +border_width_right = 6 +border_width_bottom = 6 +border_color = Color(1, 1, 1, 1) + +[resource] +Button/colors/font_color = Color(1, 1, 1, 1) +Button/colors/font_focus_color = Color(1, 1, 1, 1) +Button/colors/font_hover_color = Color(1, 1, 1, 1) +Button/colors/font_hover_pressed_color = Color(1, 1, 1, 1) +Button/colors/font_pressed_color = Color(1, 1, 1, 1) +Button/font_sizes/font_size = 20 +Button/styles/disabled = SubResource("StyleBoxFlat_wc0q8") +Button/styles/hover = SubResource("StyleBoxFlat_0avsd") +Button/styles/hover_pressed = SubResource("StyleBoxFlat_wykhr") +Button/styles/normal = SubResource("StyleBoxFlat_1id7b") +Button/styles/pressed = SubResource("StyleBoxFlat_78ekx") diff --git a/world.tscn b/world.tscn new file mode 100644 index 0000000..61409aa --- /dev/null +++ b/world.tscn @@ -0,0 +1,12 @@ +[gd_scene format=3 uid="uid://blhs4mjutgugy"] + +[ext_resource type="PackedScene" uid="uid://drfuhbhan42q8" path="res://components/Menus/Start.tscn" id="1_f3sb7"] +[ext_resource type="PackedScene" uid="uid://3mu73nyxqj7l" path="res://components/Menus/Main.tscn" id="2_fj7yv"] + +[node name="world" type="Node2D" unique_id=1702698981] + +[node name="ui" type="CanvasLayer" parent="." unique_id=508148609] + +[node name="MainMenu" parent="ui" unique_id=1584365993 instance=ExtResource("2_fj7yv")] + +[node name="StartMenu" parent="ui" unique_id=1823905463 instance=ExtResource("1_f3sb7")]