Menu animation

This commit is contained in:
Иван Кузьменко 2023-08-19 12:28:56 +03:00
parent 619ed0c88e
commit 4826bc4035
15 changed files with 462 additions and 2 deletions

View file

@ -1,20 +1,205 @@
[gd_scene load_steps=6 format=3 uid="uid://c7w8oqlobjae0"]
[gd_scene load_steps=27 format=3 uid="uid://c7w8oqlobjae0"]
[ext_resource type="Script" path="res://scripts/Menu.cs" id="1_dlrmp"]
[ext_resource type="Texture2D" uid="uid://6jcrm4u5rcbv" path="res://sprites/menu/titlescreen_background.png" id="2_33c6c"]
[ext_resource type="AudioStream" uid="uid://ilvpdkvibr7c" path="res://sounds/thunderclap.ogg" id="2_nviw8"]
[ext_resource type="Script" path="res://scripts/MovingParallaxBackground.cs" id="2_tnooi"]
[ext_resource type="Texture2D" uid="uid://bb1hhlsglrau1" path="res://sprites/menu/titlescreen_clouds_ground.png" id="3_43xmf"]
[ext_resource type="Theme" uid="uid://daxgxg7c8v0ih" path="res://themes/zx_theme.tres" id="3_d3ur4"]
[ext_resource type="Texture2D" uid="uid://ccsapi8rvble0" path="res://sprites/menu/titlescreen_clouds_upper.png" id="4_e00o5"]
[ext_resource type="Texture2D" uid="uid://cphsndjg0uscm" path="res://sprites/menu/titlescreen_forest.png" id="5_4ir6m"]
[ext_resource type="Texture2D" uid="uid://blvrq6d54adds" path="res://sprites/menu/titlescreen_ground.png" id="6_mxyri"]
[ext_resource type="Texture2D" uid="uid://c42emgl2wlf0f" path="res://sprites/menu/QoL_logo.png" id="7_jjakx"]
[ext_resource type="Shader" path="res://shaders/dithering.gdshader" id="11_qi6kn"]
[ext_resource type="Shader" path="res://shaders/light_shader.gdshader" id="12_64ts1"]
[sub_resource type="Animation" id="Animation_6kcty"]
resource_name = "intro_animation"
length = 2.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CanvasLayer/Title:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0, -192), Vector2(0, 0)]
}
[sub_resource type="Animation" id="Animation_cwn47"]
resource_name = "thunder"
length = 2.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SubViewport/CG:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2, 0.6, 0.8, 0.9, 1.7, 2.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(1, 1, 1, 1), Color(0, 0, 0, 1), Color(0, 0, 0, 1), Color(1, 1, 1, 1), Color(0, 0, 0, 1), Color(0, 0, 0, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MenuBackground/CloudsLayer/CloudsGround:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0, 100), Vector2(0, 57)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("MenuBackground/CloudsLayer/CloudsUpper:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0, -100), Vector2(0, 0)]
}
[sub_resource type="Animation" id="Animation_i3sd6"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SubViewport/CG:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0, 0, 0, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MenuBackground/CloudsLayer/CloudsGround:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 57)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("MenuBackground/CloudsLayer/CloudsUpper:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mjata"]
_data = {
"intro_animation": SubResource("Animation_6kcty")
"RESET": SubResource("Animation_i3sd6"),
"intro_animation": SubResource("Animation_6kcty"),
"thunder": SubResource("Animation_cwn47")
}
[sub_resource type="ShaderMaterial" id="ShaderMaterial_imjyj"]
shader = ExtResource("11_qi6kn")
[sub_resource type="Gradient" id="Gradient_qqpai"]
interpolation_mode = 1
offsets = PackedFloat32Array(1)
colors = PackedColorArray(1, 1, 1, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_igsq0"]
gradient = SubResource("Gradient_qqpai")
width = 256
height = 192
[sub_resource type="Gradient" id="Gradient_xdseu"]
interpolation_mode = 1
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0, 0, 0, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_xfqs2"]
gradient = SubResource("Gradient_xdseu")
height = 12
[sub_resource type="ShaderMaterial" id="ShaderMaterial_eqq24"]
shader = ExtResource("11_qi6kn")
[sub_resource type="ViewportTexture" id="ViewportTexture_3wi17"]
viewport_path = NodePath("SubViewport")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_6hgmx"]
shader = ExtResource("12_64ts1")
[sub_resource type="Gradient" id="Gradient_84uml"]
interpolation_mode = 2
offsets = PackedFloat32Array(1)
colors = PackedColorArray(1, 1, 1, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_1l0ke"]
gradient = SubResource("Gradient_84uml")
width = 256
height = 192
[node name="Menu" type="Node2D"]
script = ExtResource("1_dlrmp")
[node name="MenuBackground" type="ParallaxBackground" parent="."]
scroll_base_scale = Vector2(1, 0)
script = ExtResource("2_tnooi")
[node name="BackgroundLayer" type="ParallaxLayer" parent="MenuBackground"]
motion_scale = Vector2(10, 0)
motion_mirroring = Vector2(256, 0)
[node name="BackClouds" type="Sprite2D" parent="MenuBackground/BackgroundLayer"]
texture = ExtResource("2_33c6c")
centered = false
[node name="CloudsLayer" type="ParallaxLayer" parent="MenuBackground"]
motion_scale = Vector2(20, 0)
motion_mirroring = Vector2(256, 0)
[node name="CloudsGround" type="Sprite2D" parent="MenuBackground/CloudsLayer"]
position = Vector2(0, 57)
texture = ExtResource("3_43xmf")
centered = false
[node name="CloudsUpper" type="Sprite2D" parent="MenuBackground/CloudsLayer"]
texture = ExtResource("4_e00o5")
centered = false
[node name="ForestLayer" type="ParallaxLayer" parent="MenuBackground"]
motion_scale = Vector2(30, 0)
motion_mirroring = Vector2(256, 0)
[node name="Forest" type="Sprite2D" parent="MenuBackground/ForestLayer"]
texture = ExtResource("5_4ir6m")
centered = false
[node name="GroundLayer" type="ParallaxLayer" parent="MenuBackground"]
motion_scale = Vector2(40, 0)
motion_mirroring = Vector2(256, 0)
[node name="Ground" type="Sprite2D" parent="MenuBackground/GroundLayer"]
texture = ExtResource("6_mxyri")
centered = false
[node name="Camera2D" type="Camera2D" parent="."]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
@ -29,8 +214,44 @@ one_shot = true
[node name="Thunderclap" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource("2_nviw8")
[node name="SubViewport" type="SubViewport" parent="."]
disable_3d = true
transparent_bg = true
canvas_item_default_texture_filter = 0
size = Vector2i(256, 192)
render_target_update_mode = 4
[node name="CG" type="CanvasGroup" parent="SubViewport"]
modulate = Color(0, 0, 0, 1)
material = SubResource("ShaderMaterial_imjyj")
[node name="Sprite2D" type="Sprite2D" parent="SubViewport/CG"]
texture = SubResource("GradientTexture2D_igsq0")
centered = false
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Title" type="TextureRect" parent="CanvasLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -192.0
offset_bottom = -192.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("7_jjakx")
[node name="LabelBackground" type="TextureRect" parent="CanvasLayer"]
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -19.0
offset_bottom = -7.0
grow_horizontal = 2
grow_vertical = 0
texture = SubResource("GradientTexture2D_xfqs2")
[node name="Label" type="Label" parent="CanvasLayer"]
anchors_preset = 12
anchor_top = 1.0
@ -45,4 +266,24 @@ text = "Press Start or Enter"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Flash" type="TextureRect" parent="CanvasLayer"]
clip_children = 2
material = SubResource("ShaderMaterial_eqq24")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("ViewportTexture_3wi17")
[node name="Invert" type="TextureRect" parent="CanvasLayer/Flash"]
material = SubResource("ShaderMaterial_6hgmx")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture2D_1l0ke")
[connection signal="timeout" from="Timer" to="." method="ChangeScene"]

View file

@ -4,19 +4,23 @@ public partial class Menu : Node2D
{
private Timer _timer;
private AudioStreamPlayer2D _thunderclap;
private AnimationPlayer _animationPlayer;
public override void _Ready()
{
_timer = (Timer)FindChild("Timer");
_thunderclap = (AudioStreamPlayer2D)FindChild("Thunderclap");
_animationPlayer = (AnimationPlayer)FindChild("AnimationPlayer");
GameManager.IsPlaying = false;
_animationPlayer.Play("intro_animation");
}
public override void _Input(InputEvent @event)
{
if (@event.IsActionPressed("ui_confirm") && _timer.IsStopped())
{
_animationPlayer.Play("thunder");
_thunderclap.Play();
_timer.Start();
}

View file

@ -0,0 +1,11 @@
using Godot;
public partial class MovingParallaxBackground : ParallaxBackground
{
[Export] public Vector2 Speed;
public override void _Process(double delta)
{
ScrollOffset += Speed * (float)delta;
}
}

BIN
sprites/menu/QoL_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c42emgl2wlf0f"
path="res://.godot/imported/QoL_logo.png-46d8739b8ece32e2adeb97d00bc17226.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/menu/QoL_logo.png"
dest_files=["res://.godot/imported/QoL_logo.png-46d8739b8ece32e2adeb97d00bc17226.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://6jcrm4u5rcbv"
path="res://.godot/imported/titlescreen_background.png-6c7d31efd845c20429085ddd9ed8ff84.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/menu/titlescreen_background.png"
dest_files=["res://.godot/imported/titlescreen_background.png-6c7d31efd845c20429085ddd9ed8ff84.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bb1hhlsglrau1"
path="res://.godot/imported/titlescreen_clouds_ground.png-894591c264b66404f892c5437bb449fa.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/menu/titlescreen_clouds_ground.png"
dest_files=["res://.godot/imported/titlescreen_clouds_ground.png-894591c264b66404f892c5437bb449fa.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ccsapi8rvble0"
path="res://.godot/imported/titlescreen_clouds_upper.png-3cdb785ab6c6224a283bb33edbc2f043.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/menu/titlescreen_clouds_upper.png"
dest_files=["res://.godot/imported/titlescreen_clouds_upper.png-3cdb785ab6c6224a283bb33edbc2f043.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cphsndjg0uscm"
path="res://.godot/imported/titlescreen_forest.png-fd107d62c32f48c79975511457caf12a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/menu/titlescreen_forest.png"
dest_files=["res://.godot/imported/titlescreen_forest.png-fd107d62c32f48c79975511457caf12a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://blvrq6d54adds"
path="res://.godot/imported/titlescreen_ground.png-3cd508b66166d6b46429477ef55e44b2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/menu/titlescreen_ground.png"
dest_files=["res://.godot/imported/titlescreen_ground.png-3cd508b66166d6b46429477ef55e44b2.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