1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

加了更好的激光效果,但是trae仍然司马

This commit is contained in:
2025-08-28 21:02:44 +08:00
parent 4b037027df
commit 265ea2fe65
8 changed files with 326 additions and 23 deletions
+237 -17
View File
@@ -1,19 +1,214 @@
[gd_scene load_steps=7 format=3 uid="uid://e7ci24ysgbyg"]
[gd_scene load_steps=20 format=3 uid="uid://ltqx7fyovhla"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_cqnkd"]
[ext_resource type="Script" path="res://scripts/Contents/Bullets/BigLaser.gd" id="2_oqfvl"]
[ext_resource type="Shader" path="res://shaders/Laser.gdshader" id="3_25t1x"]
[ext_resource type="Shader" path="res://shaders/BigLaser1.gdshader" id="3_f1hf4"]
[ext_resource type="Texture2D" uid="uid://dy4op6n6vxef3" path="res://resources/bullets/laser-circle/circle.svg" id="4_hbtg4"]
[sub_resource type="SpriteFrames" id="SpriteFrames_yip5k"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_5n8cv"]
shader = ExtResource("3_25t1x")
shader_parameter/color = Color(0.823162, 0.116294, 1.92523e-07, 1)
shader_parameter/laser_width = 0.01
shader_parameter/soft_edge = 0.5
[sub_resource type="ShaderMaterial" id="ShaderMaterial_b2oy8"]
shader = ExtResource("3_f1hf4")
shader_parameter/laser_color = Color(1, 0, 0, 1)
shader_parameter/width = 1.0
shader_parameter/softness = 0.237
shader_parameter/wave_speed = 2.0
shader_parameter/wave_frequency = 13.154
shader_parameter/wave_amplitude = 1.151
shader_parameter/wave_width = 0.032
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_y85id"]
radius = 60.0
[sub_resource type="Curve" id="Curve_m7ued"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_iykvy"]
curve = SubResource("Curve_m7ued")
[sub_resource type="Curve" id="Curve_7w1gn"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_nimkb"]
curve = SubResource("Curve_7w1gn")
[sub_resource type="Gradient" id="Gradient_ki7oc"]
colors = PackedColorArray(0.546875, 0.546875, 0.546875, 1, 1, 1, 1, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_csn21"]
gradient = SubResource("Gradient_ki7oc")
[sub_resource type="Gradient" id="Gradient_krx08"]
offsets = PackedFloat32Array(0, 0.450382)
colors = PackedColorArray(1, 1, 1, 1, 1, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_l66oc"]
gradient = SubResource("Gradient_krx08")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_n3bsp"]
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(0, 1000, 1)
angle_min = 1.07288e-05
angle_max = 360.0
angle_curve = SubResource("CurveTexture_nimkb")
spread = 15.0
initial_velocity_min = -500.0
initial_velocity_max = 500.0
gravity = Vector3(0, 0, 0)
scale_min = 3.0
scale_max = 15.0
color_ramp = SubResource("GradientTexture1D_l66oc")
color_initial_ramp = SubResource("GradientTexture1D_csn21")
alpha_curve = SubResource("CurveTexture_iykvy")
[sub_resource type="Animation" id="Animation_ep0ow"]
resource_name = "spawn"
length = 5.0
step = 0.05
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("rect:position:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 50, -0.25, 0, 0.25, 0, 50, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.5, 4.5, 5)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("rect:scale:x")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0),
"points": PackedFloat32Array(1e-05, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 1e-05, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.5, 4.5, 5)
}
tracks/2/type = "bezier"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("circle:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"handle_modes": PackedInt32Array(0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 12.5664, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 5)
}
tracks/3/type = "bezier"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("circle:scale:x")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0),
"points": PackedFloat32Array(1e-05, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 1e-05, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.5, 4.5, 5)
}
tracks/4/type = "bezier"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("circle:scale:y")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0),
"points": PackedFloat32Array(1e-05, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 1e-05, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.5, 4.5, 5)
}
tracks/5/type = "bezier"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("circle:modulate:a")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.5, 4.5, 5)
}
[sub_resource type="Animation" id="Animation_1rif1"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("rect:position:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -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("rect:scale:x")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(1e-05, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/2/type = "bezier"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("circle:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/3/type = "bezier"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("circle:scale:x")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(1e-05, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/4/type = "bezier"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("circle:scale:y")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(1e-05, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/5/type = "bezier"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("circle:modulate:a")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_s7tee"]
_data = {
"RESET": SubResource("Animation_1rif1"),
"spawn": SubResource("Animation_ep0ow")
}
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_x66th"]
radius = 40.0
height = 2000.0
[node name="BigLaser" instance=ExtResource("1_cqnkd")]
@@ -23,21 +218,46 @@ fields = {
1: 25,
2: 1
}
lifeTime = 5000.0
needEnergy = 100.0
autoSpawnAnimation = true
freeAfterSpawn = true
knockback = 10.0
[node name="texture" parent="." index="0"]
rotation = 1.5708
sprite_frames = SubResource("SpriteFrames_yip5k")
[node name="rect" type="ColorRect" parent="texture" index="0"]
material = SubResource("ShaderMaterial_5n8cv")
offset_left = -60.0
offset_top = -2000.0
offset_right = 60.0
material = SubResource("ShaderMaterial_b2oy8")
offset_left = 233.0
offset_right = 333.0
offset_bottom = 2000.0
rotation = -1.5708
scale = Vector2(1e-05, 1)
[node name="particles" type="GPUParticles2D" parent="texture/rect" index="0"]
position = Vector2(50, 1000)
amount = 400
process_material = SubResource("ParticleProcessMaterial_n3bsp")
lifetime = 0.25
visibility_rect = Rect2(-100, -1000, 200, 2000)
[node name="launcher" type="Polygon2D" parent="texture/rect" index="1"]
position = Vector2(50, -21)
rotation = 1.5708
color = Color(1, 0.6, 0, 1)
polygon = PackedVector2Array(-50, -25, 0, 0, -50, 25)
[node name="animator" parent="texture" index="1"]
libraries = {
"": SubResource("AnimationLibrary_s7tee")
}
[node name="circle" type="Sprite2D" parent="texture" index="2"]
modulate = Color(1, 1, 1, 0)
scale = Vector2(1e-05, 1e-05)
texture = ExtResource("4_hbtg4")
[node name="hitbox" parent="." index="1"]
position = Vector2(1000, 0)
position = Vector2(1234, 0)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_y85id")
shape = SubResource("CapsuleShape2D_x66th")
+2 -2
View File
@@ -185,7 +185,7 @@ expand_mode = 1
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("5_widd7")
text = "50.0"
text = "%current%"
[node name="sep" type="Label" parent="root/energy/container/energy"]
layout_mode = 2
@@ -196,7 +196,7 @@ text = "/"
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("5_widd7")
text = "100.0"
text = "%max%"
[node name="percent" parent="root/energy/container" instance=ExtResource("9_44nw8")]
unique_name_in_owner = true
+2 -2
View File
@@ -43,7 +43,7 @@ tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 0, 0),
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 1.5, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0),
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 1.25, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.5, 3)
}
tracks/1/type = "bezier"
@@ -54,7 +54,7 @@ tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0, 0, 0),
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 1.5, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0),
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0, 1.25, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.5, 3)
}
+1 -1
View File
@@ -21,7 +21,7 @@ script_export_mode=2
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
binary_format/embed_pck=true
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
binary_format/architecture="x86_64"
@@ -0,0 +1 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="267.38095" height="267.38095" viewBox="0,0,267.38095,267.38095"><g transform="translate(-106.19762,-46.42143)"><g stroke-miterlimit="10"><path d="M111.19762,180.11191c0,-71.07379 57.61668,-128.69047 128.69048,-128.69047c71.07379,0 128.69048,57.61669 128.69048,128.69048c0,71.07379 -57.61669,128.69048 -128.69048,128.69048c-71.07379,0 -128.69047,-57.61669 -128.69047,-128.69048z" fill="none" stroke="#ffcc00" stroke-width="10" stroke-linecap="butt"/><path d="M148.87222,180.11191c0,-50.26668 40.74919,-91.01587 91.01587,-91.01587c50.26668,0 91.01587,40.74919 91.01587,91.01587c0,50.26668 -40.74919,91.01587 -91.01587,91.01587c-50.26668,0 -91.01587,-40.74919 -91.01587,-91.01587z" fill="none" stroke="#ffcc00" stroke-width="5" stroke-linecap="butt"/><path d="M240.11191,50.75v38.04762" fill="none" stroke="#ffcc00" stroke-width="5" stroke-linecap="round"/><path d="M369.25,179.8881h-38.04762" fill="none" stroke="#ffcc00" stroke-width="5" stroke-linecap="round"/><path d="M239.8881,271.20238v38.04762" fill="none" stroke="#ffcc00" stroke-width="5" stroke-linecap="round"/><path d="M148.79762,180.11191h-38.04762" fill="none" stroke="#ffcc00" stroke-width="5" stroke-linecap="round"/><g fill="#ff9900" stroke="#ff9900" stroke-width="5" stroke-linecap="round"><g><path d="M308.82678,93.60847l-15.56579,33.09831"/><path d="M326.37354,111.15524l-33.09831,15.56579"/></g><g><path d="M308.86634,93.56891l33.09831,-15.56579"/><path d="M326.41311,111.11568l15.56579,-33.09831"/></g></g><g fill="#ff9900" stroke="#ff9900" stroke-width="5" stroke-linecap="round"><g><path d="M326.4131,249.30206l15.5658,33.0983"/><path d="M308.86634,266.84882l33.0983,15.5658"/></g><g><path d="M293.27524,233.6967l33.0983,15.56579"/><path d="M308.82678,266.80927l-15.5658,-33.09831"/></g></g><g fill="#ff9900" stroke="#ff9900" stroke-width="5" stroke-linecap="round"><g><path d="M172.17915,267.2958l15.5658,-33.0983"/><path d="M154.63238,249.74903l33.09831,-15.5658"/></g><g><path d="M172.13959,267.33537l-33.09831,15.56579"/><path d="M154.59283,249.78859l-15.5658,33.0983"/></g></g><g fill="#ff9900" stroke="#ff9900" stroke-width="5" stroke-linecap="round"><g><path d="M153.61974,111.11568l-15.5658,-33.0983"/><path d="M171.16651,93.56891l-33.09831,-15.5658"/></g><g><path d="M186.75761,126.72103l-33.09831,-15.56579"/><path d="M171.20607,93.60847l15.5658,33.09831"/></g></g></g></g></svg><!--rotationCenter:133.80238:133.57857-->

After

Width:  |  Height:  |  Size: 2.4 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dy4op6n6vxef3"
path="res://.godot/imported/circle.svg-5a2dde24567dbe43464b2ef020e03b5b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/laser-circle/circle.svg"
dest_files=["res://.godot/imported/circle.svg-5a2dde24567dbe43464b2ef020e03b5b.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
+1 -1
View File
@@ -27,7 +27,7 @@ func _ready():
for feedScene in DirTool.listdir("res://components/Feeds/"):
if feedScene.get_extension() == "remap":
feedScene = feedScene.substr(0, len(feedScene) - 6)
print("正在从", feedScene, "加载饲料卡")
print("正在从 %s 加载饲料卡" % feedScene)
var feed = load(feedScene).instantiate()
avaliableFeeds.add_child(feed)
+45
View File
@@ -0,0 +1,45 @@
shader_type canvas_item;
render_mode blend_add;
uniform vec4 laser_color : source_color = vec4(1.0, 0.0, 0.0, 1.0); // 边缘颜色
uniform float width : hint_range(0.01, 1.0) = 0.1; // 激光宽度
uniform float softness : hint_range(0.01, 1.0) = 0.2; // 边缘柔和度
uniform float wave_speed : hint_range(-10.0, 10.0) = 2.0; // 波传播速度
uniform float wave_frequency : hint_range(1.0, 20.0) = 8.0; // 波频率
uniform float wave_amplitude : hint_range(0.1, 2.0) = 0.5; // 波幅度
uniform float wave_width : hint_range(0.01, 0.5) = 0.1; // 波宽度
void fragment() {
// 将UV坐标转换为以激光中心为原点的坐标
vec2 uv = UV - vec2(0.5, 0.0);
// 计算激光基础强度(中心白色,边缘渐变到laser_color
float dist = abs(uv.x) / width;
float x_dist=abs(UV.x-0.5);
float laser_intensity = 1.0 - smoothstep(0.0, softness, dist);
// 计算波的位置(沿Y轴传播)
float wave_pos = mod(TIME * wave_speed, 1.0);
// 计算当前点到波中心的距离(在Y轴上的距离)
float wave_dist = abs(uv.y - wave_pos);
// 计算波强度(高斯分布)
float wave_intensity = exp(-wave_dist * wave_dist / (2.0 * wave_width * wave_width));
// 添加波的弧形效果(在X轴上的分布)
wave_intensity *= exp(-uv.x * uv.x / (2.0 * (width * 0.5) * (width * 0.5)));
// 应用波频率和幅度
wave_intensity *= sin(wave_dist * wave_frequency * 3.14159) * wave_amplitude;
// 组合激光和波效果
float total_intensity = laser_intensity + wave_intensity;
// 颜色混合:中心白色,边缘渐变到laser_color
vec3 base_color = mix(vec3(1.0), laser_color.rgb, 1.0 - laser_intensity);
vec3 color = base_color + vec3(wave_intensity);
// 设置最终颜色(加法混合模式会忽略alpha)
COLOR = vec4(color, 0.5-x_dist);
}