c01s06 增加猫鼠游戏小孩影子的变化与阴影光效

This commit is contained in:
cakipaul 2025-01-25 13:57:28 +08:00
parent 13221ecb10
commit 8b32c6eb24
38 changed files with 112 additions and 506 deletions

View File

@ -4,15 +4,16 @@ class_name ProAnimatedSprite2D extends AnimatedSprite2D
@export var autostart := true @export var autostart := true
@export var action_configs: Array[Dictionary] = [] @export var action_configs: Array[Dictionary] = []
@export var move_configs: Array[Dictionary] = [] @export var move_configs: Array[Dictionary] = []
# 0.0 means no light
# 从 intro 到 next 的配置信息 # negative value means subtract, positive value means add
var auto_checkout_dict = { @export_range(-1.0, 1.0) var light_energy := 0.0:
# intro -> {state_config instance} set(val):
} light2d.energy = abs(val)
# 播放 animation 的同时,进行移动 if val > 0:
var animation_velocity = { light2d.blend_mode = Light2D.BLEND_MODE_ADD
# animation -> velocity else:
} light2d.blend_mode = Light2D.BLEND_MODE_SUB
light_energy = val
const ACTION_CONFIG = { const ACTION_CONFIG = {
"animation_intro": "", "intro_loop": 1, "animation_wait_time": 0.0, "animation_next": "" "animation_intro": "", "intro_loop": 1, "animation_wait_time": 0.0, "animation_next": ""
@ -29,7 +30,22 @@ static func new_action_config() -> Dictionary:
return ACTION_CONFIG.duplicate() return ACTION_CONFIG.duplicate()
# 从 intro 到 next 的配置信息
var auto_checkout_dict = {
# intro -> {state_config instance}
}
# 播放 animation 的同时,进行移动
var animation_velocity = {
# animation -> velocity
}
var light2d := PointLight2D.new()
func _ready() -> void: func _ready() -> void:
if light_energy != 0.0:
add_child(light2d)
frame_changed.connect(_on_frame_changed)
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
_load_config() _load_config()
@ -60,6 +76,13 @@ func _load_config():
if sprite_frames and sprite_frames.has_animation(move_config.animation): if sprite_frames and sprite_frames.has_animation(move_config.animation):
animation_velocity[move_config.animation] = move_config.velocity animation_velocity[move_config.animation] = move_config.velocity
func _on_frame_changed():
if light_energy == 0.0:
return
var texture = sprite_frames.get_frame_texture(animation, frame)
if not texture:
return
light2d.texture = texture
func _reset_loop(intro: String): func _reset_loop(intro: String):
for c in action_configs: for c in action_configs:
@ -96,7 +119,7 @@ func _on_animation_start():
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
if Engine.is_editor_hint() or not animation or not velocity: if Engine.is_editor_hint() or not velocity or not is_playing():
return return
position += velocity * delta position += velocity * delta

View File

@ -1,4 +1,4 @@
[gd_resource type="SpriteFrames" load_steps=163 format=3 uid="uid://c6okvaeemoodq"] [gd_resource type="SpriteFrames" load_steps=164 format=3 uid="uid://c6okvaeemoodq"]
[ext_resource type="Texture2D" uid="uid://ciai4wast4i2a" path="res://asset/art/gif/c01_孤儿院围墙/【画画小女孩】回头/0.png" id="1_0n0k8"] [ext_resource type="Texture2D" uid="uid://ciai4wast4i2a" path="res://asset/art/gif/c01_孤儿院围墙/【画画小女孩】回头/0.png" id="1_0n0k8"]
[ext_resource type="Texture2D" uid="uid://pabw11j5ifdw" path="res://asset/art/gif/c01_孤儿院围墙/【画画男孩-2】画画/0.png" id="1_3rkvk"] [ext_resource type="Texture2D" uid="uid://pabw11j5ifdw" path="res://asset/art/gif/c01_孤儿院围墙/【画画男孩-2】画画/0.png" id="1_3rkvk"]
@ -162,6 +162,7 @@
[ext_resource type="Texture2D" uid="uid://80d7y4mh7wke" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png" id="125_j0esh"] [ext_resource type="Texture2D" uid="uid://80d7y4mh7wke" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png" id="125_j0esh"]
[ext_resource type="Texture2D" uid="uid://bhv5gcebvkmql" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png" id="126_rcm44"] [ext_resource type="Texture2D" uid="uid://bhv5gcebvkmql" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png" id="126_rcm44"]
[ext_resource type="Texture2D" uid="uid://yyyj4ibmrvhx" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png" id="127_xhrct"] [ext_resource type="Texture2D" uid="uid://yyyj4ibmrvhx" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png" id="127_xhrct"]
[ext_resource type="Texture2D" uid="uid://30e5snyr1o4l" path="res://asset/art/gif/c01_孤儿院围墙/摔倒隐藏小孩.png" id="134_1pcyy"]
[resource] [resource]
animations = [{ animations = [{
@ -694,6 +695,9 @@ animations = [{
}, { }, {
"duration": 3.0, "duration": 3.0,
"texture": ExtResource("98_iq3wq") "texture": ExtResource("98_iq3wq")
}, {
"duration": 1.0,
"texture": ExtResource("134_1pcyy")
}], }],
"loop": false, "loop": false,
"name": &"【胖小孩背着残疾小孩】摔倒", "name": &"【胖小孩背着残疾小孩】摔倒",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ch7sorr2jnb1t"
path="res://.godot/imported/1.png-19eb0a50efbc549e55f92717b260008b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】抖动/1.png"
dest_files=["res://.godot/imported/1.png-19eb0a50efbc549e55f92717b260008b.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.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bloqmhyil08qp"
path="res://.godot/imported/3.png-0d9360819e94b056b1a88bd79e7871b9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】抖动/3.png"
dest_files=["res://.godot/imported/3.png-0d9360819e94b056b1a88bd79e7871b9.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.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cnvkoehxc2s58"
path="res://.godot/imported/4.png-1d3e1efe967cf9b9b5ecfad330c7281a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】抖动/4.png"
dest_files=["res://.godot/imported/4.png-1d3e1efe967cf9b9b5ecfad330c7281a.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.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cqxqcdvlb3a08"
path="res://.godot/imported/5.png-e1210b8ce7e5e212ce04f977894a92e3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】抖动/5.png"
dest_files=["res://.godot/imported/5.png-e1210b8ce7e5e212ce04f977894a92e3.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.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bwt3q8abx8bsp"
path="res://.godot/imported/6.png-3c4c7e3ba74bb4013542f85b7bac33ea.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】抖动/6.png"
dest_files=["res://.godot/imported/6.png-3c4c7e3ba74bb4013542f85b7bac33ea.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.

Before

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://58wlm2pxlpxa"
path="res://.godot/imported/0.png-999e1486ad290cc84d3664e2b2286141.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】掉落/0.png"
dest_files=["res://.godot/imported/0.png-999e1486ad290cc84d3664e2b2286141.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.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://yyqamu28qa1v"
path="res://.godot/imported/1.png-ad6134815ac0143ab1d93e4c9e929c1d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】掉落/1.png"
dest_files=["res://.godot/imported/1.png-ad6134815ac0143ab1d93e4c9e929c1d.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.

Before

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dnlhthikxny5q"
path="res://.godot/imported/2.png-9d8167c1083fc5206710e8767e20ee50.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】掉落/2.png"
dest_files=["res://.godot/imported/2.png-9d8167c1083fc5206710e8767e20ee50.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.

Before

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ciswkyrbaiad"
path="res://.godot/imported/3.png-a56faf48af4e907b566980ad1c477746.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】掉落/3.png"
dest_files=["res://.godot/imported/3.png-a56faf48af4e907b566980ad1c477746.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.

Before

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bqjkw6jle2q1o"
path="res://.godot/imported/4.png-66db4febb68c2df13428f1a714c50ede.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】掉落/4.png"
dest_files=["res://.godot/imported/4.png-66db4febb68c2df13428f1a714c50ede.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.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cpfncgg1jsxrt"
path="res://.godot/imported/5.png-a88da2c44fe9674a9e5d5125fe3c3e4b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】掉落/5.png"
dest_files=["res://.godot/imported/5.png-a88da2c44fe9674a9e5d5125fe3c3e4b.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: 1.4 KiB

View File

@ -2,16 +2,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://chlw04ml6do80" uid="uid://30e5snyr1o4l"
path="res://.godot/imported/0.png-1b00775b641931f91e59257a4e8505dd.ctex" path="res://.godot/imported/摔倒隐藏小孩.png-c1a191a3b66700dd7c488c324831bea6.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】抖动/0.png" source_file="res://asset/art/gif/c01_孤儿院围墙/摔倒隐藏小孩.png"
dest_files=["res://.godot/imported/0.png-1b00775b641931f91e59257a4e8505dd.ctex"] dest_files=["res://.godot/imported/摔倒隐藏小孩.png-c1a191a3b66700dd7c488c324831bea6.ctex"]
[params] [params]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cnwm70jpsplrj"
path="res://.godot/imported/1.jpg-4dc5a26b4eda17f83429e1fa71c1f88d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.jpg"
dest_files=["res://.godot/imported/1.jpg-4dc5a26b4eda17f83429e1fa71c1f88d.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.

Before

Width:  |  Height:  |  Size: 64 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://csgqj6gvh0p1w"
path="res://.godot/imported/2.jpg-cf1a7ee1ab38c428f5c1fa38b622b7be.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.jpg"
dest_files=["res://.godot/imported/2.jpg-cf1a7ee1ab38c428f5c1fa38b622b7be.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: 20 KiB

View File

@ -2,16 +2,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://dkdnplv1p3ldv" uid="uid://dfw3y2elkdcvr"
path="res://.godot/imported/2.png-709190ced18cb22d041a888f11c9c1ba.ctex" path="res://.godot/imported/bg_树.png-3bcb4e25cae5b1cc21f16f0c68663a0a.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】抖动/2.png" source_file="res://asset/art/scene/c01/s06_孤儿院长廊围墙/bg_树.png"
dest_files=["res://.godot/imported/2.png-709190ced18cb22d041a888f11c9c1ba.ctex"] dest_files=["res://.godot/imported/bg_树.png-3bcb4e25cae5b1cc21f16f0c68663a0a.ctex"]
[params] [params]

View File

@ -20,6 +20,7 @@ script = ExtResource("1_0vrlo")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."] [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
[node name="BGColorRect" type="ColorRect" parent="."] [node name="BGColorRect" type="ColorRect" parent="."]
z_index = -10
custom_minimum_size = Vector2(664, 318) custom_minimum_size = Vector2(664, 318)
anchors_preset = 4 anchors_preset = 4
anchor_top = 0.5 anchor_top = 0.5
@ -34,6 +35,7 @@ color = Color(0, 0, 0, 1)
[node name="BGSprite2D" type="Sprite2D" parent="."] [node name="BGSprite2D" type="Sprite2D" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
z_index = -5
centered = false centered = false
offset = Vector2(0, -120) offset = Vector2(0, -120)

View File

@ -19,6 +19,7 @@ var standing_kid1
var standing_kid2 var standing_kid2
var standing_kid3 var standing_kid3
var game_kid var game_kid
var game_kid_limp
var obstacles: ProAnimatedSprite2D var obstacles: ProAnimatedSprite2D
var interactable_obstacles: Interactable2D var interactable_obstacles: Interactable2D
var cat_rat_game_start_ambush: Ambush2D var cat_rat_game_start_ambush: Ambush2D
@ -47,17 +48,17 @@ func _on_ground_ready() -> void:
obstacles = $"../DeployLayer/游戏中途桌椅" obstacles = $"../DeployLayer/游戏中途桌椅"
interactable_obstacles = $"../DeployLayer/Interactable桌椅" interactable_obstacles = $"../DeployLayer/Interactable桌椅"
interactable_obstacles.interacted.connect(_on_push_obstacles) interactable_obstacles.interacted.connect(_on_push_obstacles)
cat_rat_game_fail_ambush = $"../DeployLayer/【胖小孩背着残疾小孩】/猫鼠游戏失败ambush" cat_rat_game_fail_ambush = $"../DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】/猫鼠游戏失败ambush"
# 等待游戏开始后启用 # 等待游戏开始后启用
cat_rat_game_fail_ambush.enabled = false cat_rat_game_fail_ambush.enabled = false
cat_rat_game_start_ambush = $"../DeployLayer/猫鼠游戏开始ambush" cat_rat_game_start_ambush = $"../DeployLayer/猫鼠游戏开始ambush"
cat_rat_game_mid_ambush = $"../DeployLayer/猫鼠游戏中途ambush" cat_rat_game_mid_ambush = $"../DeployLayer/猫鼠游戏中途ambush"
cat_rat_game_mid_ambush.triggered.connect(_on_cat_rat_game_obstacles_triggered) cat_rat_game_mid_ambush.triggered.connect(_on_cat_rat_game_obstacles_triggered)
# cat_rat_game_success_ambush = $"../DeployLayer/猫鼠游戏胜利ambush" as Ambush2D # cat_rat_game_success_ambush = $"../DeployLayer/猫鼠游戏胜利ambush" as Ambush2D
cat_shadow = $"../BGSprite2D/【墙上小孩猫影子】" game_kid_limp = $"../DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】"
cat_shadow = $"../DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】/【墙上小孩猫影子】"
cat = $"../DeployLayer/【墙上黑猫】" cat = $"../DeployLayer/【墙上黑猫】"
cat.visible = false game_kid_limp.modulate.a = 0.0
cat_shadow.visible = false
# 院长翻书 # 院长翻书
var timer = Timer.new() var timer = Timer.new()
@ -99,8 +100,6 @@ func _game_counting_down(_res = null):
var left = player.global_position.x var left = player.global_position.x
player.player_movement_rect.position.x = left player.player_movement_rect.position.x = left
get_tree().create_timer(2.5).timeout.connect(_kids_start_run) get_tree().create_timer(2.5).timeout.connect(_kids_start_run)
cat_shadow.visible = true
cat_shadow.play("【墙上小孩猫影子】变身")
cat.visible = true cat.visible = true
cat.play("【墙上黑猫】跑步") cat.play("【墙上黑猫】跑步")
@ -144,9 +143,17 @@ func _on_cat_rat_game_obstacles_triggered():
SceneManager.pop_debug_dialog_info("美术", "桌椅颤抖-翻倒, 【胖小孩背着残疾小孩】摔倒,获得成就") SceneManager.pop_debug_dialog_info("美术", "桌椅颤抖-翻倒, 【胖小孩背着残疾小孩】摔倒,获得成就")
obstacles.play("桌椅颤抖-翻倒") obstacles.play("桌椅颤抖-翻倒")
game_kid.play("【胖小孩背着残疾小孩】摔倒") game_kid.play("【胖小孩背着残疾小孩】摔倒")
game_kid.sprite_frames.set_animation_loop("【胖小孩背着残疾小孩】摔倒", false)
game_kid.animation_finished.connect(_on_kid_fall_finished, CONNECT_ONE_SHOT)
_on_mid_ambush_success() _on_mid_ambush_success()
func _on_kid_fall_finished():
game_kid_limp.modulate.a = 1
game_kid_limp.play("【单残疾小孩】爬行")
cat_shadow.play("【墙上小孩猫影子】变身")
func _on_mid_ambush_success(): func _on_mid_ambush_success():
obstacles_success = true obstacles_success = true
# TODO 获得成就 # TODO 获得成就
@ -156,6 +163,9 @@ func _on_mid_ambush_success():
func game_succeed(): func game_succeed():
if not obstacles_success: if not obstacles_success:
game_kid.play_with_loop("【胖小孩背着残疾小孩】侧面呼吸") game_kid.play_with_loop("【胖小孩背着残疾小孩】侧面呼吸")
else:
game_kid_limp.pause()
cat_shadow.pause()
print("game succeed") print("game succeed")
SceneManager.pop_debug_dialog_info("美术", "猫鼠游戏成功") SceneManager.pop_debug_dialog_info("美术", "猫鼠游戏成功")
SceneManager.freeze_player(0) SceneManager.freeze_player(0)

View File

@ -65,13 +65,13 @@ size = Vector2(150, 70)
resource_local_to_scene = true resource_local_to_scene = true
size = Vector2(10, 70) size = Vector2(10, 70)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1ojoa"]
size = Vector2(20, 50)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7cdhx"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_7cdhx"]
resource_local_to_scene = true resource_local_to_scene = true
size = Vector2(30, 70) size = Vector2(30, 70)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1ojoa"]
size = Vector2(20, 50)
[node name="S06" type="Node2D"] [node name="S06" type="Node2D"]
metadata/_edit_horizontal_guides_ = [158.0, 88.0] metadata/_edit_horizontal_guides_ = [158.0, 88.0]
@ -95,23 +95,6 @@ position = Vector2(30, -6)
texture = ExtResource("3_su6aw") texture = ExtResource("3_su6aw")
centered = false centered = false
[node name="【墙上小孩猫影子】" parent="Ground/BGSprite2D" index="1" instance=ExtResource("8_ouldg")]
position = Vector2(1479, -11.5)
sprite_frames = ExtResource("7_dsj2r")
animation = &"【墙上小孩猫影子】变身"
autostart = false
action_configs = Array[Dictionary]([{
"animation_intro": &"【墙上小孩猫影子】变身",
"animation_next": "【墙上小孩猫影子】猫影跑步"
}])
move_configs = Array[Dictionary]([{
"animation": "【墙上小孩猫影子】猫影跑步",
"velocity": Vector2(180, 0)
}, {
"animation": &"【墙上小孩猫影子】变身",
"velocity": Vector2(180, 0)
}])
[node name="portal_left" parent="Ground/DeployLayer" index="0"] [node name="portal_left" parent="Ground/DeployLayer" index="0"]
position = Vector2(144, 20) position = Vector2(144, 20)
immediately = false immediately = false
@ -272,7 +255,8 @@ move_configs = Array[Dictionary]([{
}]) }])
[node name="【站立小孩-2】" parent="Ground/DeployLayer" index="14" instance=ExtResource("8_ouldg")] [node name="【站立小孩-2】" parent="Ground/DeployLayer" index="14" instance=ExtResource("8_ouldg")]
position = Vector2(1514, 0) z_index = 6
position = Vector2(1516, 16)
sprite_frames = ExtResource("7_dsj2r") sprite_frames = ExtResource("7_dsj2r")
animation = &"【站立小孩-2】呼吸" animation = &"【站立小孩-2】呼吸"
action_configs = Array[Dictionary]([{ action_configs = Array[Dictionary]([{
@ -309,6 +293,7 @@ hook_dialogue_title = "c01_s06_谈论鬼差与猫鼠游戏"
hook_method = "game_intro" hook_method = "game_intro"
[node name="【胖小孩背着残疾小孩】" parent="Ground/DeployLayer" index="17" instance=ExtResource("8_ouldg")] [node name="【胖小孩背着残疾小孩】" parent="Ground/DeployLayer" index="17" instance=ExtResource("8_ouldg")]
z_index = 1
position = Vector2(1731, 4) position = Vector2(1731, 4)
sprite_frames = ExtResource("7_dsj2r") sprite_frames = ExtResource("7_dsj2r")
animation = &"【胖小孩背着残疾小孩】呼吸" animation = &"【胖小孩背着残疾小孩】呼吸"
@ -332,33 +317,56 @@ move_configs = Array[Dictionary]([{
"velocity": Vector2(110, 0) "velocity": Vector2(110, 0)
}]) }])
[node name="猫鼠游戏失败ambush" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】" instance=ExtResource("11_tudob")] [node name="【单残疾小孩】" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】" instance=ExtResource("8_ouldg")]
position = Vector2(3, 44) z_index = 2
enabled = false z_as_relative = false
hook_method = "game_failed" position = Vector2(-23, -1)
sprite_frames = ExtResource("7_dsj2r")
animation = &"【单残疾小孩】爬行"
autostart = false
move_configs = Array[Dictionary]([{
"animation": &"【单残疾小孩】爬行",
"velocity": Vector2(100, 0)
}])
[node name="Sign" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/猫鼠游戏失败ambush" index="0"] [node name="【墙上小孩猫影子】" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】" instance=ExtResource("8_ouldg")]
enabled = false self_modulate = Color(1, 1, 1, 0.137255)
show_behind_parent = true
z_index = -1
z_as_relative = false
position = Vector2(11, -8)
sprite_frames = ExtResource("7_dsj2r")
animation = &"【墙上小孩猫影子】变身"
frame = 11
frame_progress = 1.0
autostart = false
action_configs = Array[Dictionary]([{
"animation_intro": &"【墙上小孩猫影子】变身",
"animation_next": "【墙上小孩猫影子】猫影跑步"
}])
light_energy = -0.7
[node name="CollisionShape2D" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/猫鼠游戏失败ambush/Area2D" index="0"] [node name="中途Trigger" type="Area2D" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】"]
shape = SubResource("RectangleShape2D_7cdhx") position = Vector2(30, 12)
[node name="中途Trigger" type="Area2D" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】"]
position = Vector2(7, 11)
collision_layer = 64 collision_layer = 64
collision_mask = 64 collision_mask = 64
monitoring = false monitoring = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/中途Trigger"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】/中途Trigger"]
position = Vector2(7, 48) position = Vector2(7, 48)
shape = SubResource("RectangleShape2D_1ojoa") shape = SubResource("RectangleShape2D_1ojoa")
debug_color = Color(0.519778, 0.447036, 0.929413, 0.42) debug_color = Color(0.519778, 0.447036, 0.929413, 0.42)
[node name="【单残疾小孩】" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】" instance=ExtResource("8_ouldg")] [node name="猫鼠游戏失败ambush" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】" instance=ExtResource("11_tudob")]
visible = false position = Vector2(26, 45)
position = Vector2(-23, -1) enabled = false
sprite_frames = ExtResource("7_dsj2r") hook_method = "game_failed"
animation = &"【单残疾小孩】爬行"
[node name="Sign" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】/猫鼠游戏失败ambush" index="0"]
enabled = false
[node name="CollisionShape2D" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】/猫鼠游戏失败ambush/Area2D" index="0"]
shape = SubResource("RectangleShape2D_7cdhx")
[node name="猫鼠游戏胜利ambush" parent="Ground/DeployLayer" index="18" instance=ExtResource("11_tudob")] [node name="猫鼠游戏胜利ambush" parent="Ground/DeployLayer" index="18" instance=ExtResource("11_tudob")]
position = Vector2(3021.8, 49.6) position = Vector2(3021.8, 49.6)
@ -439,4 +447,4 @@ offset = Vector2(0, -159)
[editable path="Ground/DeployLayer/Interactable桌椅"] [editable path="Ground/DeployLayer/Interactable桌椅"]
[editable path="Ground/DeployLayer/Interactable桌椅/Sign"] [editable path="Ground/DeployLayer/Interactable桌椅/Sign"]
[editable path="Ground/DeployLayer/猫鼠游戏中途ambush"] [editable path="Ground/DeployLayer/猫鼠游戏中途ambush"]
[editable path="Ground/DeployLayer/【胖小孩背着残疾小孩】/猫鼠游戏失败ambush"] [editable path="Ground/DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】/猫鼠游戏失败ambush"]

View File

@ -25,6 +25,7 @@ region_rect = Rect2(24, 76, 38, 24)
modulate_color = Color(0.996078, 0.92549, 0.85098, 0.733333) modulate_color = Color(0.996078, 0.92549, 0.85098, 0.733333)
[node name="MainPlayer" type="CharacterBody2D"] [node name="MainPlayer" type="CharacterBody2D"]
z_index = 5
collision_mask = 2 collision_mask = 2
script = ExtResource("1_3a78y") script = ExtResource("1_3a78y")
running_locked = true running_locked = true