c01s12书店外诡异版:ghost glitch特效;飘动的寻人启事
This commit is contained in:
parent
cb6e7e2b7e
commit
6983b8a398
BIN
asset/art/临时草稿/纸片.png
Normal file
BIN
asset/art/临时草稿/纸片.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 926 B |
34
asset/art/临时草稿/纸片.png.import
Normal file
34
asset/art/临时草稿/纸片.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cx8ny1barwdwy"
|
||||
path="res://.godot/imported/纸片.png-a8bd0177d01abb04bca508d0a6f52ec4.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://asset/art/临时草稿/纸片.png"
|
||||
dest_files=["res://.godot/imported/纸片.png-a8bd0177d01abb04bca508d0a6f52ec4.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
|
@ -3,21 +3,17 @@
|
||||
// texture 为蒙版 mask,用于控制雾气浓度
|
||||
shader_type canvas_item;
|
||||
uniform sampler2D noise: repeat_enable;
|
||||
// x / y
|
||||
uniform float ratio = 1.2;
|
||||
// 数字越小(越接近 0)越黑,范围在 0-1 之间
|
||||
uniform float grey_level = 0.6;
|
||||
uniform float speed = 1.;
|
||||
|
||||
void fragment() {
|
||||
float fog_alpha_1 = texture(noise, vec2(UV.x / 2.0 * ratio + TIME /100.0, UV.y / 4.0 - TIME / 100.0)).r;
|
||||
float fog_alpha_2 = texture(noise, vec2(UV.x / 2.0 * ratio + 0.5 + TIME /50.0, UV.y / 4.0 + 0.5 - TIME / 160.0)).r;
|
||||
float fog_alpha_3 = texture(noise, vec2(UV.x / 2.0 * ratio + 0.25 + TIME /25.0, UV.y / 4.0 - 0.25 - TIME / 160.0)).r;
|
||||
float fog_alpha = mix(fog_alpha_3, mix(fog_alpha_1, fog_alpha_2, 0.5), 0.7);
|
||||
// COLOR.a 越接近 1.0, factor 越接近 1.0;COLOR.a 越接近 0.0, factor 越接近 0.0
|
||||
float factor = pow(COLOR.a, 2);
|
||||
float strength = smoothstep(.0, .2, COLOR.a);
|
||||
float delta = TIME * .004 * speed;
|
||||
float fog_alpha_1 = texture(noise, vec2(UV.x + delta * 7., UV.y + delta * 2.)).r;
|
||||
float fog_alpha_2 = texture(noise, vec2(UV.x + 0.5 + delta * 4., UV.y + 0.5 - delta)).r;
|
||||
float fog_alpha_3 = texture(noise, vec2(UV.x + 0.25 + delta, UV.y - 0.25 + delta * 3.)).r;
|
||||
float fog_alpha = mix(fog_alpha_3, mix(fog_alpha_1, fog_alpha_2, 0.5), 0.66);
|
||||
// factor 越靠近 1, fog_alpha 也靠近 1; factor 越靠近 0.,fog_alpha 越靠近自己
|
||||
//COLOR.a = mix(fog_alpha, 1., factor);
|
||||
COLOR.a = mix(fog_alpha, 1., factor) * strength;
|
||||
COLOR.rgb = vec3(mix(grey_level, 1., mix(fog_alpha_1, fog_alpha_3, 0.4)));
|
||||
COLOR.a = mix(fog_alpha, 1., COLOR.a * COLOR.a) * smoothstep(.0, .2, COLOR.a);
|
||||
COLOR.rgb *= mix(grey_level, 1., fog_alpha);
|
||||
}
|
@ -36,7 +36,10 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _setup() -> void:
|
||||
texture_light.texture = texture
|
||||
if not texture:
|
||||
texture_light.enabled = false
|
||||
else:
|
||||
texture_light.texture = texture
|
||||
natural_light.scale = Vector2(ambient_light_scale, ambient_light_scale)
|
||||
natural_light.energy = ambient_light_energy
|
||||
natural_light.color = ambient_light_color
|
||||
|
64
scene/entity/partical/particals_ash_vertical.tscn
Normal file
64
scene/entity/partical/particals_ash_vertical.tscn
Normal file
@ -0,0 +1,64 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dnbutraty2285"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dskwunl50ntc5" path="res://scene/entity/partical/e_单块碎片白.png" id="1_nwcn3"]
|
||||
[ext_resource type="Texture2D" uid="uid://byko5uf05is0v" path="res://scene/entity/partical/e_单块碎片灰.png" id="2_80j7c"]
|
||||
[ext_resource type="Texture2D" uid="uid://csf2hky7p7fn5" path="res://scene/entity/partical/e_单块碎片黑.png" id="3_k6y1m"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_rwi0m"]
|
||||
offsets = PackedFloat32Array(0, 0.99, 1)
|
||||
colors = PackedColorArray(1, 1, 1, 0.466667, 1, 1, 1, 0.965333, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_5cty7"]
|
||||
gradient = SubResource("Gradient_rwi0m")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_8ybmm"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.982456, 0.10989), -1.97802, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_jq14j"]
|
||||
curve = SubResource("Curve_8ybmm")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_wa8gc"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape_scale = Vector3(1, 1, 0)
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(750, 20, 0)
|
||||
angle_min = -300.0
|
||||
angle_max = 300.0
|
||||
direction = Vector3(0, 50, 0)
|
||||
spread = 30.0
|
||||
initial_velocity_min = 5.0
|
||||
initial_velocity_max = 15.0
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.1
|
||||
scale_max = 0.5
|
||||
scale_curve = SubResource("CurveTexture_jq14j")
|
||||
color_ramp = SubResource("GradientTexture1D_5cty7")
|
||||
|
||||
[node name="ParticalsAsh" type="Node2D"]
|
||||
|
||||
[node name="white" type="GPUParticles2D" parent="."]
|
||||
amount = 300
|
||||
process_material = SubResource("ParticleProcessMaterial_wa8gc")
|
||||
texture = ExtResource("1_nwcn3")
|
||||
lifetime = 100.0
|
||||
preprocess = 20.0
|
||||
visibility_rect = Rect2(-750, 0, 1500, 600)
|
||||
metadata/_edit_vertical_guides_ = [-721.0]
|
||||
|
||||
[node name="grey" type="GPUParticles2D" parent="."]
|
||||
amount = 300
|
||||
process_material = SubResource("ParticleProcessMaterial_wa8gc")
|
||||
texture = ExtResource("2_80j7c")
|
||||
lifetime = 100.0
|
||||
preprocess = 20.0
|
||||
visibility_rect = Rect2(-750, 0, 1500, 600)
|
||||
|
||||
[node name="black" type="GPUParticles2D" parent="."]
|
||||
amount = 300
|
||||
process_material = SubResource("ParticleProcessMaterial_wa8gc")
|
||||
texture = ExtResource("3_k6y1m")
|
||||
lifetime = 100.0
|
||||
preprocess = 20.0
|
||||
visibility_rect = Rect2(-750, 0, 1500, 600)
|
||||
trail_enabled = true
|
@ -37,6 +37,7 @@ var obstacles_success = false
|
||||
|
||||
|
||||
func _on_ground_ready() -> void:
|
||||
$"../ParallaxForeground/BGParallaxLayer/Fog".visible = true
|
||||
dean = $"../ParallaxForeground/BGParallaxLayer/门口_院长"
|
||||
red_girl = $"../ParallaxForeground/BGParallaxLayer/门口_红衣姑娘"
|
||||
# drawing_kids = $"../DeployLayer/drawing_kids"
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=33 format=3 uid="uid://bx16c8nn32f40"]
|
||||
[gd_scene load_steps=32 format=3 uid="uid://bx16c8nn32f40"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_bitx7"]
|
||||
[ext_resource type="Script" path="res://scene/ground/scene/c01/s06_animation.gd" id="2_fkfhi"]
|
||||
@ -15,7 +15,6 @@
|
||||
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="11_tudob"]
|
||||
[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="12_28t76"]
|
||||
[ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="12_idjp0"]
|
||||
[ext_resource type="Texture2D" uid="uid://bbuskt4kwkwpl" path="res://asset/art/scene/c01/s07_书店外/bg_书店外_黄昏.png" id="13_2d8p4"]
|
||||
[ext_resource type="PackedScene" uid="uid://bicuc35kbn8hd" path="res://scene/shading/fog.tscn" id="14_d5def"]
|
||||
[ext_resource type="Shader" path="res://asset/shader/fog.gdshader" id="15_22a7a"]
|
||||
[ext_resource type="Texture2D" uid="uid://b7gyapghy3tsy" path="res://asset/art/neutral_point_light.png" id="15_q7j0p"]
|
||||
@ -83,8 +82,8 @@ noise_type = 2
|
||||
fractal_type = 2
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_qmfti"]
|
||||
width = 800
|
||||
height = 800
|
||||
width = 2000
|
||||
height = 400
|
||||
seamless = true
|
||||
seamless_blend_skirt = 0.25
|
||||
noise = SubResource("FastNoiseLite_jw18h")
|
||||
@ -92,8 +91,8 @@ noise = SubResource("FastNoiseLite_jw18h")
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xf6rb"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("15_22a7a")
|
||||
shader_parameter/ratio = 5.0
|
||||
shader_parameter/grey_level = 0.6
|
||||
shader_parameter/speed = 0.5
|
||||
shader_parameter/noise = SubResource("NoiseTexture2D_qmfti")
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_vduqs"]
|
||||
@ -415,12 +414,6 @@ one_shot = false
|
||||
freeze_time = 0.1
|
||||
hook_method = "game_succeed"
|
||||
|
||||
[node name="书店外" type="Sprite2D" parent="Ground/DeployLayer" index="19"]
|
||||
position = Vector2(3228, 0)
|
||||
texture = ExtResource("13_2d8p4")
|
||||
centered = false
|
||||
offset = Vector2(0, -158)
|
||||
|
||||
[node name="PointLight2D" type="PointLight2D" parent="Ground/AmbientLayer" index="0"]
|
||||
energy = 0.4
|
||||
range_layer_max = 2
|
||||
@ -497,6 +490,7 @@ animation = &"左一绿衣男呼吸"
|
||||
flip_h = true
|
||||
|
||||
[node name="Fog" parent="Ground/ParallaxForeground/BGParallaxLayer" index="8" instance=ExtResource("14_d5def")]
|
||||
visible = false
|
||||
z_index = 5
|
||||
material = SubResource("ShaderMaterial_xf6rb")
|
||||
position = Vector2(2905, -47)
|
||||
|
@ -18,16 +18,16 @@ func _ready() -> void:
|
||||
|
||||
var fog
|
||||
|
||||
|
||||
func _on_ground_ready() -> void:
|
||||
fog = $"../ParallaxForeground/BGParallaxLayer/Fog" as Fog2D
|
||||
if data.fog_disappeared:
|
||||
# 雾已经消失,直接隐藏
|
||||
fog.visible = false
|
||||
else:
|
||||
fog.visible = true
|
||||
get_tree().create_timer(5.0).timeout.connect(_on_fog_disappear)
|
||||
|
||||
|
||||
func _on_fog_disappear() -> void:
|
||||
set_data("fog_disappeared", true)
|
||||
fog.tween_fog(0, Color.TRANSPARENT, Fog2D.FOG_OFFSET_DEFAULT, 15.0, true)
|
||||
fog.tween_fog(0, Color.TRANSPARENT, Fog2D.FOG_OFFSET_DEFAULT, 15.0, true)
|
@ -13,8 +13,8 @@ noise_type = 2
|
||||
fractal_type = 2
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_qmfti"]
|
||||
width = 800
|
||||
height = 800
|
||||
width = 1600
|
||||
height = 400
|
||||
seamless = true
|
||||
seamless_blend_skirt = 0.25
|
||||
noise = SubResource("FastNoiseLite_munbn")
|
||||
@ -22,8 +22,8 @@ noise = SubResource("FastNoiseLite_munbn")
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_tskev"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("5_ers28")
|
||||
shader_parameter/ratio = 3.5
|
||||
shader_parameter/grey_level = 0.6
|
||||
shader_parameter/speed = 0.5
|
||||
shader_parameter/noise = SubResource("NoiseTexture2D_qmfti")
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_b4ng7"]
|
||||
@ -63,11 +63,20 @@ target_scene = "c02_s08"
|
||||
position = Vector2(276, 40)
|
||||
portal_name = "1"
|
||||
|
||||
[node name="portal_2" parent="Ground/DeployLayer" index="3" instance=ExtResource("4_ulvsd")]
|
||||
position = Vector2(995, 28)
|
||||
debug_note = "c01_s07 的 2 号门通往书店"
|
||||
portal_name = "2"
|
||||
target_scene = "c01_s08"
|
||||
target_portal = "left"
|
||||
status = "opened"
|
||||
|
||||
[node name="MainPlayer" parent="Ground" index="5"]
|
||||
position = Vector2(41, 91)
|
||||
character = "小小蝶"
|
||||
|
||||
[node name="Fog" parent="Ground/ParallaxForeground/BGParallaxLayer" index="0" instance=ExtResource("4_62isb")]
|
||||
visible = false
|
||||
z_index = 5
|
||||
material = SubResource("ShaderMaterial_tskev")
|
||||
position = Vector2(595, -46)
|
||||
|
@ -11,7 +11,52 @@ func _ready() -> void:
|
||||
super._ready()
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
game_node.exiting.connect(_on_game_exiting)
|
||||
game_node.success.connect(_on_game_success)
|
||||
|
||||
|
||||
var mask: ColorRect
|
||||
|
||||
|
||||
func _on_ground_ready() -> void:
|
||||
pass
|
||||
mask = $"../DeployLayer/Mask"
|
||||
var shelf_game_success = ArchiveManager.archive.get_global_value("shelf_game_success")
|
||||
if shelf_game_success:
|
||||
# 书架游戏成功后,展示诡异的街道
|
||||
_set_portal_target_to_wierd_street()
|
||||
|
||||
|
||||
var game_secne = preload("res://scene/little_game/书架.tscn")
|
||||
var game_node = game_secne.instantiate()
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if is_instance_valid(game_node):
|
||||
game_node.queue_free()
|
||||
|
||||
|
||||
func play_game() -> void:
|
||||
if game_node.get_parent() != get_parent():
|
||||
get_parent().add_child(game_node)
|
||||
SceneManager.freeze_player(0)
|
||||
# mask.color = Color(0, 0, 0, 0)
|
||||
|
||||
|
||||
func _on_game_exiting() -> void:
|
||||
if GlobalConfig.DEBUG:
|
||||
print("书架游戏 exiting")
|
||||
create_tween().tween_property(mask, "color:a", 0.0, 2.0).from(1.0)
|
||||
SceneManager.release_player()
|
||||
|
||||
|
||||
func _on_game_success() -> void:
|
||||
ArchiveManager.archive.set_global_entry("shelf_game_success", true)
|
||||
_set_portal_target_to_wierd_street()
|
||||
#TODO: 书架游戏成功后的处理
|
||||
|
||||
|
||||
func _set_portal_target_to_wierd_street() -> void:
|
||||
# 设置传送门目标为诡异的街道
|
||||
var portal = $"../DeployLayer/portal_left" as Portal2D
|
||||
portal.target_scene = "c01_s07"
|
||||
portal.target_portal = "portal_2"
|
@ -18,10 +18,16 @@ script = ExtResource("2_0lque")
|
||||
oneshot_animation = ""
|
||||
|
||||
[node name="BGSprite2D" parent="Ground" index="2"]
|
||||
position = Vector2(20, -1)
|
||||
texture = ExtResource("3_322m4")
|
||||
offset = Vector2(0, -158)
|
||||
|
||||
[node name="portal_left" parent="Ground/DeployLayer" index="0"]
|
||||
position = Vector2(35, 28)
|
||||
debug_note = "c01_s07 的 2 号门通往书店
|
||||
"
|
||||
target_scene = "c01_s07"
|
||||
target_portal = "2"
|
||||
|
||||
[node name="portal_right" parent="Ground/DeployLayer" index="1"]
|
||||
immediately = false
|
||||
target_scene = "c02_s08"
|
||||
@ -32,6 +38,22 @@ texture = ExtResource("5_tnrke")
|
||||
trigger_mode = "interact"
|
||||
one_shot = false
|
||||
freeze_time = 1.0
|
||||
hook_method = "play_game"
|
||||
|
||||
[node name="Mask" type="ColorRect" parent="Ground/DeployLayer" index="3"]
|
||||
z_index = 10
|
||||
custom_minimum_size = Vector2(700, 350)
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -53.0
|
||||
offset_top = -174.0
|
||||
offset_right = 647.0
|
||||
offset_bottom = 176.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
color = Color(0, 0, 0, 0)
|
||||
|
||||
[node name="MainPlayer" parent="Ground" index="5"]
|
||||
position = Vector2(41, 98)
|
||||
@ -41,7 +63,7 @@ character = "小小蝶"
|
||||
texture = null
|
||||
|
||||
[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"]
|
||||
points = PackedVector2Array(55, 150, 560, 150)
|
||||
points = PackedVector2Array(30, 150, 545, 150)
|
||||
|
||||
[node name="参考" type="Sprite2D" parent="Ground"]
|
||||
visible = false
|
||||
|
27
scene/ground/scene/c01/s12_animation.gd
Normal file
27
scene/ground/scene/c01/s12_animation.gd
Normal file
@ -0,0 +1,27 @@
|
||||
@tool
|
||||
extends AnimationRoot
|
||||
|
||||
|
||||
# 覆盖该方法
|
||||
func _default_data() -> Dictionary:
|
||||
return {}
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
|
||||
var ghost
|
||||
|
||||
|
||||
func _on_ground_ready() -> void:
|
||||
ghost = $"../DeployLayer/Ghost"
|
||||
# test
|
||||
call_deferred("_ghost_move")
|
||||
|
||||
|
||||
func _ghost_move() -> void:
|
||||
var tween = create_tween()
|
||||
tween.tween_property(ghost, "global_position", Vector2(1500, 0), 20.0).as_relative()
|
89
scene/ground/scene/c01/s12_书店外_诡异版.tscn
Normal file
89
scene/ground/scene/c01/s12_书店外_诡异版.tscn
Normal file
@ -0,0 +1,89 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://bol5hl68pbpgq"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_llw14"]
|
||||
[ext_resource type="Script" path="res://scene/ground/scene/c01/s12_animation.gd" id="2_krdvw"]
|
||||
[ext_resource type="Texture2D" uid="uid://bc64s5xfysrc3" path="res://asset/art/scene/c01/s07_书店外/bg_书店外_夜晚.png" id="3_npdxo"]
|
||||
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_o7hfk"]
|
||||
[ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="5_6jrnc"]
|
||||
[ext_resource type="PackedScene" uid="uid://svvlohuicvhf" path="res://scene/entity/ambient/light.tscn" id="5_kywnm"]
|
||||
[ext_resource type="Texture2D" uid="uid://dok08tovej18w" path="res://asset/art/ui/hud/normal_left.png" id="6_e8r2a"]
|
||||
[ext_resource type="PackedScene" uid="uid://dnbutraty2285" path="res://scene/entity/partical/particals_ash_vertical.tscn" id="6_mfjjt"]
|
||||
[ext_resource type="PackedScene" uid="uid://ci34db7xool2n" path="res://scene/ground/script/c01/s01_自动枯萎的花朵.tscn" id="7_aq8vg"]
|
||||
[ext_resource type="PackedScene" uid="uid://h0s5ms7r7d8g" path="res://scene/shading/ghost.tscn" id="8_gk0gq"]
|
||||
[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="9_nqlku"]
|
||||
|
||||
[node name="S12" type="Node2D"]
|
||||
|
||||
[node name="Ground" parent="." instance=ExtResource("1_llw14")]
|
||||
scene_name = "c01_s12"
|
||||
player_y = 67
|
||||
|
||||
[node name="AnimationPlayer" parent="Ground" index="0"]
|
||||
script = ExtResource("2_krdvw")
|
||||
data = {
|
||||
"fog_disappeared": false,
|
||||
"oneshot_animation_played": false
|
||||
}
|
||||
oneshot_animation = ""
|
||||
|
||||
[node name="BGSprite2D" parent="Ground" index="2"]
|
||||
texture = ExtResource("3_npdxo")
|
||||
offset = Vector2(0, -158)
|
||||
|
||||
[node name="portal_right" parent="Ground/DeployLayer" index="1"]
|
||||
immediately = false
|
||||
target_scene = "c02_s08"
|
||||
|
||||
[node name="portal_2" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_o7hfk")]
|
||||
position = Vector2(995, 28)
|
||||
debug_note = "c01_s12 的 2 号门通往书店"
|
||||
portal_name = "2"
|
||||
target_scene = "c01_s08"
|
||||
target_portal = "left"
|
||||
status = "opened"
|
||||
|
||||
[node name="Interactable寻人启事" parent="Ground/DeployLayer" index="3" instance=ExtResource("5_6jrnc")]
|
||||
visible = false
|
||||
position = Vector2(379, 55)
|
||||
texture = ExtResource("6_e8r2a")
|
||||
enabled = false
|
||||
|
||||
[node name="S01自动枯萎的花朵" parent="Ground/DeployLayer" index="4" node_paths=PackedStringArray("focus_node") instance=ExtResource("7_aq8vg")]
|
||||
position = Vector2(36, 81)
|
||||
focus_node = NodePath("../Ghost")
|
||||
|
||||
[node name="Ghost" parent="Ground/DeployLayer" index="5" instance=ExtResource("8_gk0gq")]
|
||||
z_index = 10
|
||||
position = Vector2(-159, 23)
|
||||
|
||||
[node name="Ambush玩家被抓" parent="Ground/DeployLayer/Ghost" instance=ExtResource("9_nqlku")]
|
||||
freeze_time = 0.1
|
||||
|
||||
[node name="Light" parent="Ground/AmbientLayer" index="0" instance=ExtResource("5_kywnm")]
|
||||
position = Vector2(999, -5)
|
||||
texture = null
|
||||
ambient_light_scale = 1.2
|
||||
ambient_light_energy = 0.8
|
||||
ambient_light_color = Color(0.986481, 0.370829, 0.371193, 1)
|
||||
|
||||
[node name="Light2" parent="Ground/AmbientLayer" index="1" instance=ExtResource("5_kywnm")]
|
||||
position = Vector2(1240, -6)
|
||||
texture = null
|
||||
ambient_light_scale = 1.2
|
||||
ambient_light_energy = 0.8
|
||||
ambient_light_color = Color(0.986481, 0.370829, 0.371193, 1)
|
||||
|
||||
[node name="ParticalsAsh" parent="Ground/AmbientLayer" index="2" instance=ExtResource("6_mfjjt")]
|
||||
position = Vector2(750, -200)
|
||||
|
||||
[node name="MainPlayer" parent="Ground" index="5"]
|
||||
position = Vector2(41, 91)
|
||||
character = "小小蝶"
|
||||
|
||||
[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"]
|
||||
texture = null
|
||||
|
||||
[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"]
|
||||
points = PackedVector2Array(37, 150, 1500, 150)
|
||||
|
||||
[editable path="Ground"]
|
@ -6,7 +6,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://ddcburr57lb75" path="res://asset/art/scene/c02/s12_1014诡异版/bg_衔接阴影.png" id="4_y77d6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="4_yfs7q"]
|
||||
[ext_resource type="Texture2D" uid="uid://ct12wdsm57eyy" path="res://asset/art/scene/c02/s12_1014诡异版/e_床上物品组.png" id="5_irgk5"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8ncf4d0jda8r" path="res://scene/entity/partical/particals_ash.tscn" id="5_q2aoh"]
|
||||
[ext_resource type="PackedScene" uid="uid://b8ncf4d0jda8r" path="res://scene/entity/partical/particals_ash_horizontal.tscn" id="5_q2aoh"]
|
||||
[ext_resource type="Texture2D" uid="uid://bjvungu3tb155" path="res://asset/art/scene/c02/s12_1014诡异版/fg_1014前景.png" id="6_yct81"]
|
||||
|
||||
[node name="S12" type="Node2D"]
|
||||
|
@ -50,16 +50,16 @@ func _init_flowers(scatter := scatter_on_start) -> void:
|
||||
if scatter:
|
||||
var pos = Vector2(randf() * flower_area.x, randf() * flower_area.y)
|
||||
f.position = pos
|
||||
if (
|
||||
not Engine.is_editor_hint()
|
||||
and ArchiveManager.archive.global_data_dict.has("faded_flowers")
|
||||
):
|
||||
faded_flowers = ArchiveManager.archive.global_data_dict["faded_flowers"]
|
||||
for f in flowers:
|
||||
if faded_flowers.has(f.name):
|
||||
var animation_name = fade_animation_dict.get(f.animation, "")
|
||||
if animation_name:
|
||||
f.play(animation_name)
|
||||
# if (
|
||||
# not Engine.is_editor_hint()
|
||||
# and ArchiveManager.archive.global_data_dict.has("faded_flowers")
|
||||
# ):
|
||||
# faded_flowers = ArchiveManager.archive.global_data_dict["faded_flowers"]
|
||||
# for f in flowers:
|
||||
# if faded_flowers.has(f.name):
|
||||
# var animation_name = fade_animation_dict.get(f.animation, "")
|
||||
# if animation_name:
|
||||
# f.play(animation_name)
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
@ -80,7 +80,7 @@ func _physics_process(_delta: float) -> void:
|
||||
if not focus_node or not focus_node.is_visible_in_tree():
|
||||
return
|
||||
var focus_pos_x = focus_node.global_position.x
|
||||
var faded := false
|
||||
# var faded := false
|
||||
for f in flowers:
|
||||
var f_pos_x = f.global_position.x
|
||||
var distance = abs(focus_pos_x - f_pos_x)
|
||||
@ -89,6 +89,6 @@ func _physics_process(_delta: float) -> void:
|
||||
if animation_name:
|
||||
f.play(animation_name)
|
||||
faded_flowers.append(f.name)
|
||||
faded = true
|
||||
if faded and not Engine.is_editor_hint():
|
||||
ArchiveManager.archive.global_data_dict["faded_flowers"] = faded_flowers
|
||||
# faded = true
|
||||
# if faded and not Engine.is_editor_hint():
|
||||
# ArchiveManager.archive.global_data_dict["faded_flowers"] = faded_flowers
|
||||
|
@ -56,75 +56,148 @@ animations = [{
|
||||
|
||||
[node name="S01自动枯萎的花朵" type="Node2D"]
|
||||
script = ExtResource("1_l00w7")
|
||||
flower_area = Vector2(1500, 50)
|
||||
|
||||
[node name="flower1" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(361.267, 37.2719)
|
||||
position = Vector2(281.888, 13.2162)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower2" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(130.105, 48.4146)
|
||||
position = Vector2(690.229, 15.219)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower3" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(90.0357, 29.8311)
|
||||
position = Vector2(174.205, 10.194)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower4" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(61.5162, 18.0411)
|
||||
position = Vector2(565.422, 30.5498)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower5" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(146.966, 14.3762)
|
||||
position = Vector2(892.792, 28.8082)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower6" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(320.474, 10.6263)
|
||||
position = Vector2(147.793, 38.25)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower7" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(341.667, 41.5392)
|
||||
position = Vector2(992.862, 16.1515)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_枯萎"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower8" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(287.04, 47.0337)
|
||||
position = Vector2(847.811, 25.4702)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower9" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(190.428, 2.00511)
|
||||
position = Vector2(1405.19, 10.9608)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower10" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(128.674, 24.4653)
|
||||
position = Vector2(1221.38, 20.335)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower11" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(73.9961, 8.11343)
|
||||
position = Vector2(777.194, 10.8606)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower12" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(309.109, 21.3757)
|
||||
position = Vector2(915.414, 20.246)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower13" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(718.029, 46.6113)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower14" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(1431.68, 25.2483)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower15" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(198.132, 33.0604)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower16" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(809.788, 46.8787)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower17" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(1020.75, 15.6941)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower18" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(1056.65, 11.0331)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower19" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(105.867, 26.1796)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_枯萎"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower20" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(903.377, 20.0014)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower21" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(1217.9, 44.5558)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower22" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(93.1982, 47.879)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
||||
[node name="flower23" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(1016.63, 15.2568)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower1_开放"
|
||||
autoplay = "flower1_开放"
|
||||
|
||||
[node name="flower24" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(307.934, 46.3627)
|
||||
sprite_frames = SubResource("SpriteFrames_hq611")
|
||||
animation = &"flower2_开放"
|
||||
autoplay = "flower2_开放"
|
||||
|
119
scene/ground/script/c01/s12_飘动的寻人启事.gd
Normal file
119
scene/ground/script/c01/s12_飘动的寻人启事.gd
Normal file
@ -0,0 +1,119 @@
|
||||
@tool
|
||||
extends Node2D
|
||||
|
||||
@export var velocity := 0.1
|
||||
@export var remote_node: Node2D:
|
||||
set(val):
|
||||
remote_node = val
|
||||
if is_node_ready():
|
||||
if remote_node:
|
||||
remote_transform.remote_path = remote_node.get_path()
|
||||
else:
|
||||
remote_transform.remote_path = ""
|
||||
|
||||
@export var area_size := Vector2(400, 50):
|
||||
set(val):
|
||||
area_size = val
|
||||
queue_redraw()
|
||||
@export var gizmo_outline_color := Color(0.5, 0.3, 0.4, 0.8):
|
||||
set(val):
|
||||
gizmo_outline_color = val
|
||||
queue_redraw()
|
||||
|
||||
@onready var remote_transform := $RemoteTransform2D as RemoteTransform2D
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
remote_transform.remote_path = remote_node.get_path()
|
||||
if Engine.is_editor_hint():
|
||||
# draw gizmo
|
||||
var area_rect = Rect2(Vector2.ZERO, area_size)
|
||||
# fill
|
||||
var fill_color = gizmo_outline_color
|
||||
fill_color.a = 0.4
|
||||
draw_rect(area_rect, fill_color)
|
||||
# outline
|
||||
draw_rect(area_rect, gizmo_outline_color, false, 1.0)
|
||||
|
||||
|
||||
# 最多保持 4 个点; 先生成两个在左侧,再生成两个在右侧,然后再回到左侧,以此循环,形成左右摇摆的闭合路径
|
||||
var bezier_points = []
|
||||
var current_position = Vector2.ZERO
|
||||
var weight := 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# init points
|
||||
for i in range(4):
|
||||
bezier_points.append(_rand_point())
|
||||
|
||||
|
||||
func _new_point() -> void:
|
||||
# remove the first point
|
||||
bezier_points.remove_at(0)
|
||||
# add a new point
|
||||
bezier_points.append(_rand_point())
|
||||
|
||||
|
||||
var _generated_points = -1
|
||||
|
||||
|
||||
func _rand_point() -> Vector2:
|
||||
_generated_points += 1
|
||||
# upleft,mid,downright,upright,mid,downleft,...
|
||||
match _generated_points % 6:
|
||||
0:
|
||||
_generated_points = 0
|
||||
# upleft
|
||||
return Vector2(
|
||||
randf_range(0, area_size.x * 0.3), randf_range(area_size.y * 0.6, area_size.y)
|
||||
)
|
||||
1:
|
||||
# upleft to center
|
||||
return Vector2(
|
||||
randf_range(area_size.x * 0.4, area_size.x * 0.6),
|
||||
randf_range(area_size.y * 0.3, area_size.y * 0.7)
|
||||
)
|
||||
2:
|
||||
# center to downright
|
||||
return Vector2(
|
||||
randf_range(area_size.x * 0.7, area_size.x), randf_range(0, area_size.y * 0.4)
|
||||
)
|
||||
3:
|
||||
# downright to upright
|
||||
return Vector2(
|
||||
randf_range(area_size.x * 0.7, area_size.x),
|
||||
randf_range(area_size.y * 0.6, area_size.y)
|
||||
)
|
||||
4:
|
||||
# upright to center
|
||||
return Vector2(
|
||||
randf_range(area_size.x * 0.4, area_size.x * 0.6),
|
||||
randf_range(area_size.y * 0.3, area_size.y * 0.7)
|
||||
)
|
||||
_:
|
||||
# center to downleft
|
||||
return Vector2(randf_range(0, area_size.x * 0.3), randf_range(0, area_size.y * 0.4))
|
||||
|
||||
|
||||
# 从 bezier_points 中取出 4 个点,然后进行贝塞尔曲线插值
|
||||
# 设置到 remote_transform 的 position 与 rotation
|
||||
# 速度为 velocity,权重为 weight
|
||||
func _process(delta: float) -> void:
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
weight += velocity * delta
|
||||
if weight >= 1.0:
|
||||
weight = 0.0
|
||||
_new_point()
|
||||
|
||||
var p0 = bezier_points[0]
|
||||
var p1 = bezier_points[1]
|
||||
var p2 = bezier_points[2]
|
||||
var p3 = bezier_points[3]
|
||||
|
||||
var p = p1.cubic_interpolate(p2, p0, p3, weight)
|
||||
# var p = p1.bezier_interpolate(p0, p3, p2, weight)
|
||||
remote_transform.position = p
|
||||
# bezier 插值获得角度
|
||||
remote_transform.rotation = lerp_angle(remote_transform.rotation, p1.angle_to(p2), delta)
|
18
scene/ground/script/c01/s12_飘动的寻人启事.tscn
Normal file
18
scene/ground/script/c01/s12_飘动的寻人启事.tscn
Normal file
@ -0,0 +1,18 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cn1ypquvs07wx"]
|
||||
|
||||
[ext_resource type="Script" path="res://scene/ground/script/c01/s12_飘动的寻人启事.gd" id="1_like6"]
|
||||
[ext_resource type="Texture2D" uid="uid://cx8ny1barwdwy" path="res://asset/art/临时草稿/纸片.png" id="2_46pmx"]
|
||||
|
||||
[node name="S12" type="Node2D" node_paths=PackedStringArray("remote_node")]
|
||||
position = Vector2(43, 96)
|
||||
script = ExtResource("1_like6")
|
||||
velocity = 0.4
|
||||
remote_node = NodePath("Sprite2D")
|
||||
area_size = Vector2(500, 150)
|
||||
|
||||
[node name="RemoteTransform2D" type="RemoteTransform2D" parent="."]
|
||||
remote_path = NodePath("/root/@EditorNode@16896/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@25/DockVSplitCenter/@VSplitContainer@52/@VBoxContainer@53/@PanelContainer@98/MainScreen/@CanvasItemEditor@9280/@VSplitContainer@9102/@HSplitContainer@9104/@HSplitContainer@9106/@Control@9107/@SubViewportContainer@9108/@SubViewport@9109/S12/Sprite2D")
|
||||
update_scale = false
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_46pmx")
|
@ -1,5 +1,8 @@
|
||||
@tool
|
||||
extends Control
|
||||
# @tool
|
||||
extends CanvasLayer
|
||||
|
||||
signal exiting
|
||||
signal success
|
||||
|
||||
const NON_SELECTED = [-1, -1]
|
||||
|
||||
@ -201,4 +204,12 @@ func _get_color(index: int) -> int:
|
||||
func _success() -> void:
|
||||
print("Success!")
|
||||
#TODO
|
||||
pass
|
||||
success.emit()
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
# 阻塞输入
|
||||
get_viewport().set_input_as_handled()
|
||||
if event.is_action_pressed("cancel"):
|
||||
exiting.emit()
|
||||
get_parent().remove_child(self)
|
||||
|
@ -193,14 +193,7 @@ region = Rect2(1030, 621, 13, 90)
|
||||
atlas = ExtResource("6_pxxx5")
|
||||
region = Rect2(1077, 621, 13, 90)
|
||||
|
||||
[node name="书架" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
[node name="书架" type="CanvasLayer"]
|
||||
script = ExtResource("1_8af23")
|
||||
shuffle_times = 1
|
||||
|
||||
@ -842,7 +835,6 @@ texture_normal = SubResource("AtlasTexture_6p2po")
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(564, 38.5)
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
@ -857,7 +849,6 @@ color = Color(0, 0, 0, 1)
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(564, 38.5)
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
|
@ -69,6 +69,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme_override_constants/margin_left = 32
|
||||
theme_override_constants/margin_top = 64
|
||||
theme_override_constants/margin_right = 32
|
||||
|
@ -32,8 +32,8 @@ noise_type = 2
|
||||
fractal_type = 2
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_qmfti"]
|
||||
width = 800
|
||||
height = 800
|
||||
width = 600
|
||||
height = 400
|
||||
seamless = true
|
||||
seamless_blend_skirt = 0.25
|
||||
noise = SubResource("FastNoiseLite_jw18h")
|
||||
@ -41,8 +41,8 @@ noise = SubResource("FastNoiseLite_jw18h")
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fv2fx"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("1_b8eb0")
|
||||
shader_parameter/ratio = 1.2
|
||||
shader_parameter/grey_level = 0.6
|
||||
shader_parameter/speed = 1.0
|
||||
shader_parameter/noise = SubResource("NoiseTexture2D_qmfti")
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_xeqgs"]
|
||||
@ -127,7 +127,7 @@ animations = [{
|
||||
|
||||
[node name="Fog" type="AnimatedSprite2D"]
|
||||
material = SubResource("ShaderMaterial_fv2fx")
|
||||
position = Vector2(286, 161)
|
||||
position = Vector2(286, 162)
|
||||
sprite_frames = SubResource("SpriteFrames_xeqgs")
|
||||
animation = &"inverted_point_light_masks"
|
||||
frame = 23
|
||||
|
46
scene/shading/ghost.gdshader
Normal file
46
scene/shading/ghost.gdshader
Normal file
@ -0,0 +1,46 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
// 振動の強さ
|
||||
uniform float shake_power = 0.01;
|
||||
// 振動率
|
||||
uniform float shake_rate : hint_range( 0.0, 1.0 ) = 0.2;
|
||||
// 振動速度
|
||||
uniform float shake_speed = 6.;
|
||||
// 振動ブロックサイズ
|
||||
uniform float shake_block_size = 10.;
|
||||
// 色の分離率
|
||||
uniform float shake_color_rate : hint_range( 0.0, 1.0 ) = 0.01;
|
||||
// スクリーン
|
||||
uniform sampler2D screen_texture : hint_screen_texture;
|
||||
|
||||
float random( float seed )
|
||||
{
|
||||
return fract( 543.2543 * sin( dot( vec2( seed, seed ), vec2( 3525.46, -54.3415 ) ) ) );
|
||||
}
|
||||
|
||||
void fragment( )
|
||||
{
|
||||
float enable_shift = float(
|
||||
random( trunc( TIME * shake_speed ) ) < shake_rate
|
||||
);
|
||||
vec2 fixed_uv = SCREEN_UV;
|
||||
fixed_uv.x += (
|
||||
random(
|
||||
( trunc( SCREEN_UV.y * shake_block_size ) / shake_block_size )
|
||||
+ TIME
|
||||
) - 0.5
|
||||
) * shake_power * enable_shift;
|
||||
vec4 pixel_color = textureLod( screen_texture, fixed_uv, 0.0);
|
||||
pixel_color.r = mix(
|
||||
pixel_color.r
|
||||
, textureLod( screen_texture, fixed_uv + vec2( shake_color_rate, 0.0 ), 0.0 ).r
|
||||
, enable_shift
|
||||
);
|
||||
pixel_color.b = mix(
|
||||
pixel_color.b
|
||||
, textureLod( screen_texture, fixed_uv + vec2( -shake_color_rate, 0.0 ), 0.0 ).b
|
||||
, enable_shift
|
||||
);
|
||||
//COLOR.rgb = mix(COLOR.rgb, pixel_color.rgb, .5);
|
||||
COLOR.rgb = smoothstep(.1, .0, pixel_color.rgb);
|
||||
}
|
27
scene/shading/ghost.tscn
Normal file
27
scene/shading/ghost.tscn
Normal file
@ -0,0 +1,27 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://h0s5ms7r7d8g"]
|
||||
|
||||
[ext_resource type="Shader" path="res://scene/shading/ghost.gdshader" id="1_n4q4i"]
|
||||
[ext_resource type="Texture2D" uid="uid://b7gyapghy3tsy" path="res://asset/art/neutral_point_light.png" id="2_y00i5"]
|
||||
[ext_resource type="Texture2D" uid="uid://bc64s5xfysrc3" path="res://asset/art/scene/c01/s07_书店外/bg_书店外_夜晚.png" id="4_lap87"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fv2fx"]
|
||||
shader = ExtResource("1_n4q4i")
|
||||
shader_parameter/shake_power = 0.01
|
||||
shader_parameter/shake_rate = 1.0
|
||||
shader_parameter/shake_speed = 6.0
|
||||
shader_parameter/shake_block_size = 5.0
|
||||
shader_parameter/shake_color_rate = 0.005
|
||||
|
||||
[node name="Ghost" type="Sprite2D"]
|
||||
material = SubResource("ShaderMaterial_fv2fx")
|
||||
position = Vector2(135, 130)
|
||||
texture = ExtResource("2_y00i5")
|
||||
|
||||
[node name="BackBufferCopy" type="BackBufferCopy" parent="."]
|
||||
copy_mode = 2
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
show_behind_parent = true
|
||||
position = Vector2(595, -10)
|
||||
texture = ExtResource("4_lap87")
|
@ -57,8 +57,8 @@ noise_type = 2
|
||||
fractal_type = 2
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_qmfti"]
|
||||
width = 800
|
||||
height = 800
|
||||
width = 700
|
||||
height = 500
|
||||
seamless = true
|
||||
seamless_blend_skirt = 0.25
|
||||
noise = SubResource("FastNoiseLite_jw18h")
|
||||
@ -66,7 +66,8 @@ noise = SubResource("FastNoiseLite_jw18h")
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_iyc4r"]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource("4_sglhm")
|
||||
shader_parameter/ratio = 1.0
|
||||
shader_parameter/grey_level = 0.6
|
||||
shader_parameter/speed = 1.0
|
||||
shader_parameter/noise = SubResource("NoiseTexture2D_qmfti")
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_sypgq"]
|
||||
@ -210,7 +211,7 @@ copy_mode = 2
|
||||
[node name="Fog" parent="." instance=ExtResource("7_7084x")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
self_modulate = Color(0.8, 0.8, 0.8, 0.5)
|
||||
self_modulate = Color(0.8, 0.8, 0.8, 0.494118)
|
||||
material = SubResource("ShaderMaterial_iyc4r")
|
||||
|
||||
[node name="Cloud" type="AnimatedSprite2D" parent="."]
|
||||
|
Loading…
Reference in New Issue
Block a user