书店外 npc 互动气泡(卖艺小孩&讨钱的碗); 飘动的寻人启事互动逻辑

This commit is contained in:
cakipaul 2025-02-12 15:03:41 +08:00
parent 311478a400
commit e8e5d533a0
27 changed files with 286 additions and 81 deletions

View File

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

View File

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bebirk1fwldg2"
path="res://.godot/imported/老鼠.png-ec72ce9b9d545fd97136d899edf3f074.ctex"
path="res://.godot/imported/老鼠.png-d8f5f08cdc4ec5a66e505be7c72d4693.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/little_game/老鼠/老鼠.png"
dest_files=["res://.godot/imported/老鼠.png-ec72ce9b9d545fd97136d899edf3f074.ctex"]
source_file="res://asset/art/临时草稿/老鼠/老鼠.png"
dest_files=["res://.godot/imported/老鼠.png-d8f5f08cdc4ec5a66e505be7c72d4693.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

View File

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://crdphnglw5tv8"
path="res://.godot/imported/花.png-253551d934c1db4768dd5bcf7b145c5b.ctex"
path="res://.godot/imported/花.png-714c34fcea1ff047741b6cf1bd454c10.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://asset/art/little_game/自动枯萎的花/花.png"
dest_files=["res://.godot/imported/花.png-253551d934c1db4768dd5bcf7b145c5b.ctex"]
source_file="res://asset/art/临时草稿/自动枯萎的花/花.png"
dest_files=["res://.godot/imported/花.png-714c34fcea1ff047741b6cf1bd454c10.ctex"]
[params]

View File

@ -12,6 +12,19 @@ c01_老人喂食_2,“它们说......等它们吃饱了......”,,老人,,
c01_老人喂食_3,“吃饱了......就会帮我找......”,,老人,,
c01_老人喂食_4,“帮我找到我的孩子......”,,老人,,
c01_在这儿吗,“在这儿吗......”,,,,
c01_s05_夜行船1,(念诵夜行船——),,吕萍,,[#wait=4]
c01_s05_夜行船2,(疑惑——),,吕萍,,
c01_s06_谈论鬼差1,(台词设计)鬼差...你知道吗?,,小胖孩,,
c01_s06_谈论鬼差2,(台词设计)我听奶奶说...,,小孩甲,,
c01_s06_谈论鬼差3,(台词设计)好有意思...我能和你们一起玩吗...,,小蝶,,
c01_s06_谈论鬼差4,(台词设计)嗳,你知道鬼差捉人,就像猫捉鼠吗?,,小胖孩,,
c01_s06_谈论鬼差5,(台词设计)你来和我们一起玩猫鼠游戏,我们就和你一起玩,你来当老鼠吧!,,小胖孩,,
c01_s06_谈论鬼差6,(台词设计)啊?可是...,,小蝶,,
c01_s06_谈论鬼差7,(台词设计)开始咯5...4...,,小胖孩,,[#wait=2]
c01_s06_谈论鬼差8,啊!,,小蝶,,[#wait=0.5]
c01_s06_谈论鬼差9,(台词设计)3...2...1...,,小胖孩,,[#wait=3]
c01_s07_吉祥话1,(吉祥话文本)恭喜发财!,,小孩甲,,
c01_s07_吉祥话2,(吉祥话文本)恭喜!,,小孩乙,,
c01_吕萍与车夫_01,“又是这个梦”,,吕萍,,
c01_吕萍与车夫_02,“这个星期已经第三次了”,,吕萍,,
c01_吕萍与车夫_03,“我到底是怎么了”,,吕萍,,
@ -42,14 +55,3 @@ c01_吕萍与车夫_27,“哎哟,谢什么”,,车夫,,
c01_吕萍与车夫_28,“哦,位子上这份信是你的吧,别忘记了”,,车夫,,
c01_吕萍与车夫_29,“对的对的,差点就忘记了,谢谢师傅,新年快乐”,,吕萍,,
c01_吕萍与车夫_30,“新年快乐”,,车夫,,
c01_s05_夜行船1,(念诵夜行船——),,吕萍,,[#wait=4]
c01_s05_夜行船2,(疑惑——),,吕萍,,
c01_s06_谈论鬼差1,(台词设计)鬼差...你知道吗?,,小胖孩,,
c01_s06_谈论鬼差2,(台词设计)我听奶奶说...,,小孩甲,,
c01_s06_谈论鬼差3,(台词设计)好有意思...我能和你们一起玩吗...,,小蝶,,
c01_s06_谈论鬼差4,(台词设计)嗳,你知道鬼差捉人,就像猫捉鼠吗?,,小胖孩,,
c01_s06_谈论鬼差5,(台词设计)你来和我们一起玩猫鼠游戏,我们就和你一起玩,你来当老鼠吧!,,小胖孩,,
c01_s06_谈论鬼差6,(台词设计)啊?可是...,,小蝶,,
c01_s06_谈论鬼差7,(台词设计)开始咯5...4...,,小胖孩,,
c01_s06_谈论鬼差8,(台词设计)啊!,,小蝶,,
c01_s06_谈论鬼差9,(台词设计)3...2...1...,,小胖孩,,

1 keys zh_CN en _character _notes _tags
12 c01_老人喂食_3 “吃饱了......就会帮我找......” 老人
13 c01_老人喂食_4 “帮我找到我的孩子......” 老人
14 c01_在这儿吗 “在这儿吗......”
15 c01_s05_夜行船1 (念诵夜行船——) 吕萍 [#wait=4]
16 c01_s05_夜行船2 (疑惑——) 吕萍
17 c01_s06_谈论鬼差1 (台词设计)鬼差...你知道吗? 小胖孩
18 c01_s06_谈论鬼差2 (台词设计)我听奶奶说... 小孩甲
19 c01_s06_谈论鬼差3 (台词设计)好有意思...我能和你们一起玩吗... 小蝶
20 c01_s06_谈论鬼差4 (台词设计)嗳,你知道鬼差捉人,就像猫捉鼠吗? 小胖孩
21 c01_s06_谈论鬼差5 (台词设计)你来和我们一起玩猫鼠游戏,我们就和你一起玩,你来当老鼠吧! 小胖孩
22 c01_s06_谈论鬼差6 (台词设计)啊?可是... 小蝶
23 c01_s06_谈论鬼差7 (台词设计)开始咯!5...4... 小胖孩 [#wait=2]
24 c01_s06_谈论鬼差8 啊! 小蝶 [#wait=0.5]
25 c01_s06_谈论鬼差9 (台词设计)3...2...1... 小胖孩 [#wait=3]
26 c01_s07_吉祥话1 (吉祥话文本)恭喜发财! 小孩甲
27 c01_s07_吉祥话2 (吉祥话文本)恭喜! 小孩乙
28 c01_吕萍与车夫_01 “又是这个梦” 吕萍
29 c01_吕萍与车夫_02 “这个星期已经第三次了” 吕萍
30 c01_吕萍与车夫_03 “我到底是怎么了” 吕萍
55 c01_吕萍与车夫_28 “哦,位子上这份信是你的吧,别忘记了” 车夫
56 c01_吕萍与车夫_29 “对的对的,差点就忘记了,谢谢师傅,新年快乐” 吕萍
57 c01_吕萍与车夫_30 “新年快乐” 车夫
c01_s05_夜行船1 (念诵夜行船——) 吕萍 [#wait=4]
c01_s05_夜行船2 (疑惑——) 吕萍
c01_s06_谈论鬼差1 (台词设计)鬼差...你知道吗? 小胖孩
c01_s06_谈论鬼差2 (台词设计)我听奶奶说... 小孩甲
c01_s06_谈论鬼差3 (台词设计)好有意思...我能和你们一起玩吗... 小蝶
c01_s06_谈论鬼差4 (台词设计)嗳,你知道鬼差捉人,就像猫捉鼠吗? 小胖孩
c01_s06_谈论鬼差5 (台词设计)你来和我们一起玩猫鼠游戏,我们就和你一起玩,你来当老鼠吧! 小胖孩
c01_s06_谈论鬼差6 (台词设计)啊?可是... 小蝶
c01_s06_谈论鬼差7 (台词设计)开始咯!5...4... 小胖孩
c01_s06_谈论鬼差8 (台词设计)啊! 小蝶
c01_s06_谈论鬼差9 (台词设计)3...2...1... 小胖孩

View File

@ -20,7 +20,6 @@
=> END
~ c01_s05_院长房间_开场
吕萍: (念诵夜行船——)[#wait=4] [ID:c01_s05_夜行船1]
吕萍: (疑惑——)[ID:c01_s05_夜行船2]

View File

@ -80,6 +80,9 @@ c01_倾斜的洋相片,洋相片,,,,
c01_摆正的洋相片,是院长的女儿吗,,,,
c01_s06_院长房间,这是院长的房间,,,,
c01_s06_小朋友房间,这是其他小朋友的房间,,,,
c01_s07_钱碗,碗⾥是铜钱,,,,
c01_s07_书店展柜,"好多书...
要是能在这里工作就好了",,,,
c02_小蝉寻人启事_脸部破碎,"似乎是一张寻人启事
脸的部分被撕掉了,看不清",,,,
c02_卫生宣传画,几张卫生宣传画,,,,

1 keys zh_CN en _character _notes _tags
80 c01_s06_小朋友房间 这是其他小朋友的房间
81 c02_小蝉寻人启事_脸部破碎 c01_s07_钱碗 似乎是一张寻人启事 脸的部分被撕掉了,看不清 碗⾥是铜钱
82 c02_卫生宣传画 c01_s07_书店展柜 几张卫生宣传画 好多书... 要是能在这里工作就好了
83 c02_小蝉寻人启事_脸部破碎 似乎是一张寻人启事 脸的部分被撕掉了,看不清
84 c02_卫生宣传画 几张卫生宣传画
85 c02_老鼠洞 一个老鼠洞 在这种楼里挺常见的
86 c02_老鼠洞 c02_十几年前的报纸 一个老鼠洞 在这种楼里挺常见的 十几年前的报纸
87 c02_十几年前的报纸 c02_绳子剪刀 十几年前的报纸 绳子和剪刀
88 c02_绳子剪刀 c02_玩具缺脑袋 绳子和剪刀 这个玩具缺了个脑袋

View File

@ -77,6 +77,9 @@
# c01-s06 院子
这是院长的房间 [ID:c01_s06_院长房间]
这是其他小朋友的房间 [ID:c01_s06_小朋友房间]
# c01-s07 书店外
碗⾥是铜钱 [ID:c01_s07_钱碗]
好多书...\n要是能在这里工作就好了 [ID:c01_s07_书店展柜]
# c02
# c02-s01 街道

View File

@ -1,3 +1,5 @@
keys,zh_CN,_character,_notes,_tags,en
c02_张胖子_招呼吕萍5,“来来来,过来,过来”,张胖子,,[#anonymous],
c02_吕萍问方瞎子_2,“祸福在己,当自求;兴衰有数,莫强留”,方瞎子,,[#anonymous],
c01_s07_吉祥话1,(吉祥话文本)恭喜发财!,小孩甲,,,
c01_s07_吉祥话2,(吉祥话文本)恭喜!,小孩乙,,,

1 keys zh_CN _character _notes _tags en
2 c02_张胖子_招呼吕萍5 “来来来,过来,过来” 张胖子 [#anonymous]
3 c02_吕萍问方瞎子_2 “祸福在己,当自求;兴衰有数,莫强留” 方瞎子 [#anonymous]
4 c01_s07_吉祥话1 (吉祥话文本)恭喜发财! 小孩甲
5 c01_s07_吉祥话2 (吉祥话文本)恭喜! 小孩乙

View File

@ -13,3 +13,11 @@
~ 方瞎子_01
方瞎子: “祸福在己,当自求;兴衰有数,莫强留” [ID:c02_吕萍问方瞎子_2]
=> END
~ c01_s07_吉祥话1
小孩甲: (吉祥话文本)恭喜发财! [ID:c01_s07_吉祥话1]
=> END
~ c01_s07_吉祥话2
小孩乙: (吉祥话文本)恭喜! [ID:c01_s07_吉祥话2]
=> END

View File

@ -8,6 +8,7 @@ signal read_note
enabled = val
if is_node_ready():
sign_mark.enabled = val
@export var action := 3 #3为none; 4为lookup_wall; 之后为其他动作,请参考 PlayerAnimationConfig
@export_enum("os", "ballon") var mode = "os"
@export_enum("items", "c01", "c02", "c03", "c04", "c05") var dialogue := "items":
set(val):
@ -92,14 +93,14 @@ func _show_os(res, title):
else:
break
SceneManager.pop_os(lines)
SceneManager.freeze_player(1.0, PlayerAnimationConfig.ACTION_LOOKUP_WALL)
SceneManager.freeze_player(1.0, action)
func _show_balloon(res, title):
# SceneManager.focus_node(self)
DialogueManager.show_dialogue_balloon(res, title)
# TODO note viewing animation
SceneManager.freeze_player(0)
SceneManager.freeze_player(0, action)
interacting = true
DialogueManager.dialogue_ended.connect(_on_ballon_ended, CONNECT_ONE_SHOT)
# var player = SceneManager.get_player()

View File

@ -11,6 +11,7 @@ resource_local_to_scene = true
size = Vector2(20, 60)
[node name="Note" type="Sprite2D"]
position = Vector2(1, 0)
script = ExtResource("1_3igk8")
note_key = ""

View File

@ -8,6 +8,11 @@ extends AnimatedSprite2D
anonymous = val
if is_node_ready() and not Engine.is_editor_hint():
ArchiveManager.archive.npc_anonymous_states[character_name] = val
@export var height := 60.0:
set(val):
height = val
if is_node_ready():
speaking_sign.position.y = -height
@onready var speaking_animation = %SpeakingAnimationPlayer
@onready var speaking_sign = %SpeakingSign2D as Node2D
@ -18,28 +23,43 @@ var dialogue_title := ""
var dialogue_res = preload("res://asset/dialogue/npc.dialogue")
func _init() -> void:
if Engine.is_editor_hint():
return
if character_name and ArchiveManager.archive.npc_anonymous_states.has(character_name):
anonymous = ArchiveManager.archive.npc_anonymous_states[character_name]
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
if Engine.is_editor_hint():
speaking_sign.visible = true
return
speaking_sign.visible = false
speaking_sign.position.y = -height
if character_name:
var from_archive = false
if ArchiveManager.archive.npc_anonymous_states.has(character_name):
from_archive = true
anonymous = ArchiveManager.archive.npc_anonymous_states[character_name]
if GlobalConfig.DEBUG:
print(
"NPC [",
character_name,
"] is anonymous:",
anonymous,
" from archive:",
from_archive
)
if animation:
play()
area2d.body_entered.connect(_reset)
area2d.body_exited.connect(_on_cancel)
sign_mark.interacted.connect(_on_interacted)
sign_mark.cancel.connect(_on_cancel)
sign_mark.cancel.connect(_stop)
sign_mark.toggle_active.connect(_on_toggle_active)
func _on_toggle_active(activated: bool) -> void:
if activated:
_speaking()
else:
_stop()
func _on_interacted() -> void:
# %Sfx.play()
speaking_animation.play("speaking")
# _speaking()
# play dialogue
if dialogue_title:
# 适配匿名效果
@ -52,14 +72,14 @@ func _on_interacted() -> void:
DialogueManager.show_dialogue_balloon(dialogue_res, dialogue_title)
func _on_cancel(_body = null):
speaking_animation.play("RESET")
func _reset(_body = null):
func _speaking() -> void:
speaking_animation.play("speaking")
func _stop() -> void:
speaking_animation.play("RESET")
func _get(property: StringName) -> Variant:
if property == "dialogue_title":
return dialogue_title

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://0sofmhrl358m"]
[gd_scene load_steps=14 format=3 uid="uid://0sofmhrl358m"]
[ext_resource type="Script" path="res://scene/entity/npc.gd" id="1_jegr2"]
[ext_resource type="SpriteFrames" uid="uid://b7fhheih1hbvf" path="res://config/animation/entity_sprite_frames.tres" id="3_1e8sl"]
@ -14,56 +14,81 @@ length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SpeakingSign2D/Sprite2D:texture")
tracks/0/path = NodePath("SpeakingSign2D/Sprite2D:offset")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [null]
"update": 0,
"values": [Vector2(60, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SpeakingSign2D/Sprite2D:offset")
tracks/1/path = NodePath("SpeakingSign2D/Sprite2D:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
"update": 1,
"values": [0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("SpeakingSign2D:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_a386j"]
resource_name = "speaking"
length = 1.5
loop_mode = 1
capture_included = true
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SpeakingSign2D/Sprite2D:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/path = NodePath("SpeakingSign2D/Sprite2D:offset")
tracks/0/interp = 2
tracks/0/loop_wrap = false
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [ExtResource("5_foitt"), ExtResource("6_2n6ge"), ExtResource("7_afjxr")]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SpeakingSign2D/Sprite2D:offset")
tracks/1/interp = 2
tracks/1/loop_wrap = false
tracks/1/keys = {
"times": PackedFloat32Array(0, 1, 1.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(60, 0), Vector2(0, 0), Vector2(0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SpeakingSign2D/Sprite2D:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = false
tracks/1/keys = {
"times": PackedFloat32Array(0, 1.5),
"transitions": PackedFloat32Array(1, 1),
"update": 2,
"values": [0, 2]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("SpeakingSign2D:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_pjqf1"]
_data = {
@ -71,6 +96,23 @@ _data = {
"speaking": SubResource("Animation_a386j")
}
[sub_resource type="SpriteFrames" id="SpriteFrames_k7dca"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("5_foitt")
}, {
"duration": 1.0,
"texture": ExtResource("6_2n6ge")
}, {
"duration": 1.0,
"texture": ExtResource("7_afjxr")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4fuic"]
resource_local_to_scene = true
size = Vector2(61, 112.75)
@ -107,10 +149,13 @@ texture_scale = 0.1
[node name="SpeakingSign2D" type="Node2D" parent="."]
unique_name_in_owner = true
position = Vector2(0, -62)
visible = false
position = Vector2(0, -60)
scale = Vector2(0.1, 0.1)
[node name="Sprite2D" type="Sprite2D" parent="SpeakingSign2D"]
[node name="Sprite2D" type="AnimatedSprite2D" parent="SpeakingSign2D"]
sprite_frames = SubResource("SpriteFrames_k7dca")
offset = Vector2(60, 0)
[node name="Area2D" type="Area2D" parent="."]
unique_name_in_owner = true

View File

@ -3,6 +3,7 @@ class_name Sign extends Control
signal interacted
signal cancel
signal toggle_active(activated: bool)
@export var enabled := true:
set(val):
@ -38,7 +39,9 @@ var tween: Tween
var player_touching := false
var activated = false:
set(val):
if activated != val:
activated = val
toggle_active.emit(activated)
# queue_redraw()
# var sprite2d = Sprite2D.new()
var base_scale = Vector2.ONE

View File

@ -1,12 +1,15 @@
[gd_scene load_steps=12 format=3 uid="uid://ds2iyfndwamiy"]
[gd_scene load_steps=15 format=3 uid="uid://ds2iyfndwamiy"]
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_2vqpo"]
[ext_resource type="Script" path="res://scene/ground/scene/c01/s07_animation.gd" id="2_dhaq4"]
[ext_resource type="Texture2D" uid="uid://bbuskt4kwkwpl" path="res://asset/art/scene/c01/s07_书店外/bg_书店外_黄昏.png" id="3_l7171"]
[ext_resource type="PackedScene" uid="uid://bicuc35kbn8hd" path="res://scene/shading/fog.tscn" id="4_62isb"]
[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_ulvsd"]
[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="5_3pha1"]
[ext_resource type="Shader" path="res://asset/shader/fog.gdshader" id="5_ers28"]
[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="6_fw22n"]
[ext_resource type="Texture2D" uid="uid://cs56isj1je50a" path="res://asset/art/scene/c01/s07_书店外/fog_mask.png" id="7_bukhd"]
[ext_resource type="SpriteFrames" uid="uid://c6okvaeemoodq" path="res://asset/art/gif/c01_孤儿院围墙/frames.tres" id="7_q4jxv"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_munbn"]
noise_type = 2
@ -41,7 +44,7 @@ animations = [{
[node name="Ground" parent="." instance=ExtResource("1_2vqpo")]
scene_name = "c01_s07"
player_y = 67
player_y = 55
[node name="AnimationPlayer" parent="Ground" index="0"]
script = ExtResource("2_dhaq4")
@ -56,6 +59,7 @@ texture = ExtResource("3_l7171")
offset = Vector2(0, -158)
[node name="portal_right" parent="Ground/DeployLayer" index="1"]
position = Vector2(1499, 31)
target_scene = "c02_s08"
[node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_ulvsd")]
@ -70,8 +74,39 @@ target_scene = "c01_s08"
target_portal = "left"
status = "opened"
[node name="Note钱碗" parent="Ground/DeployLayer" index="4" instance=ExtResource("5_3pha1")]
position = Vector2(568, 69)
title_filter = "c01"
note_key = "c01_s07_钱碗"
[node name="Note橱柜" parent="Ground/DeployLayer" index="5" instance=ExtResource("5_3pha1")]
position = Vector2(933, 29)
action = 5
title_filter = "c01"
note_key = "c01_s07_书店展柜"
[node name="Npc小孩甲" parent="Ground/DeployLayer" index="6" instance=ExtResource("6_fw22n")]
position = Vector2(403, 12)
sprite_frames = ExtResource("7_q4jxv")
animation = &"【胖小孩背着残疾小孩】正面呼吸"
frame_progress = 0.0
character_name = "小孩甲"
anonymous = false
height = 0.0
dialogue_title = "c01_s07_吉祥话1"
[node name="Npc小孩乙" parent="Ground/DeployLayer" index="7" instance=ExtResource("6_fw22n")]
position = Vector2(455, 13)
sprite_frames = ExtResource("7_q4jxv")
animation = &"【胖小孩背着残疾小孩】正面呼吸"
frame_progress = 0.0
character_name = "小孩乙"
anonymous = false
height = 0.0
dialogue_title = "c01_s07_吉祥话2"
[node name="MainPlayer" parent="Ground" index="5"]
position = Vector2(41, 91)
position = Vector2(41, 103)
character = "小小蝶"
[node name="Fog" parent="Ground/ParallaxForeground/BGParallaxLayer" index="0" instance=ExtResource("4_62isb")]

View File

@ -15,13 +15,16 @@ func _ready() -> void:
game_node.success.connect(_on_game_success)
var ladder: Ambush2D
var mask: ColorRect
func _on_ground_ready() -> void:
ladder = $"../DeployLayer/Ambush梯子"
mask = $"../DeployLayer/Mask"
var shelf_game_success = ArchiveManager.archive.get_global_value("shelf_game_success")
if shelf_game_success:
ladder.enabled = false
_game_success_setup()
else:
$"../DeployLayer/自动跟随的老鼠".visible = false
@ -52,9 +55,11 @@ func _on_game_exiting() -> void:
func _on_game_success() -> void:
ArchiveManager.archive.set_global_entry("shelf_game_success", true)
ladder.enabled = false
_game_success_setup()
# TODO 播放小蝶从书架跌倒的动画
SceneManager.pop_debug_dialog_info("美术", "小蝶从书架跌倒")
SceneManager.release_player()
func _game_success_setup() -> void:

View File

@ -58,6 +58,7 @@ color = Color(0, 0, 0, 0)
[node name="自动跟随的老鼠" parent="Ground/DeployLayer" index="4" instance=ExtResource("6_05do1")]
position = Vector2(-8, 88)
action_area = Vector2(600, 32)
scatter_on_start = true
[node name="MainPlayer" parent="Ground" index="5"]
position = Vector2(41, 98)

View File

@ -18,6 +18,7 @@ var ghost
func _on_ground_ready() -> void:
ghost = $"../DeployLayer/Ghost"
$"../DeployLayer/飘动的寻人启事".visible = true
# test
# call_deferred("_ghost_move")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://bol5hl68pbpgq"]
[gd_scene load_steps=14 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"]
@ -11,6 +11,7 @@
[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"]
[ext_resource type="PackedScene" uid="uid://cn1ypquvs07wx" path="res://scene/ground/script/c01/s12_飘动的寻人启事.tscn" id="11_pwu7i"]
[ext_resource type="PackedScene" uid="uid://nwpbl5yuh280" path="res://scene/ground/script/c01/s00_自动跟随的老鼠.tscn" id="12_qpv8m"]
[node name="S12" type="Node2D"]
@ -64,6 +65,11 @@ freeze_time = 0.1
[node name="自动跟随的老鼠" parent="Ground/DeployLayer" index="6" instance=ExtResource("12_qpv8m")]
position = Vector2(-7, 80)
action_area = Vector2(1550, 40)
scatter_on_start = true
[node name="飘动的寻人启事" parent="Ground/DeployLayer" index="7" instance=ExtResource("11_pwu7i")]
visible = false
position = Vector2(99, -70)
[node name="Light" parent="Ground/AmbientLayer" index="0" instance=ExtResource("5_kywnm")]
position = Vector2(999, -5)

View File

@ -36,10 +36,16 @@ func _ready() -> void:
if Engine.is_editor_hint():
queue_redraw()
_init_mice()
visibility_changed.connect(_on_visibility_changed)
func _on_visibility_changed() -> void:
if visible and is_node_ready() and not Engine.is_editor_hint():
_init_mice()
func _enter_tree() -> void:
if is_node_ready():
if is_node_ready() and not Engine.is_editor_hint():
_init_mice()

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=6 format=3 uid="uid://nwpbl5yuh280"]
[ext_resource type="Script" path="res://scene/ground/script/c01/s00_自动跟随的老鼠.gd" id="1_lesfu"]
[ext_resource type="Texture2D" uid="uid://bebirk1fwldg2" path="res://asset/art/little_game/老鼠/老鼠.png" id="2_6u35i"]
[ext_resource type="Texture2D" uid="uid://bebirk1fwldg2" path="res://asset/art/临时草稿/老鼠/老鼠.png" id="2_6u35i"]
[sub_resource type="AtlasTexture" id="AtlasTexture_6ljga"]
atlas = ExtResource("2_6u35i")

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=8 format=3 uid="uid://ci34db7xool2n"]
[ext_resource type="Script" path="res://scene/ground/script/c01/s01_自动枯萎的花朵.gd" id="1_l00w7"]
[ext_resource type="Texture2D" uid="uid://crdphnglw5tv8" path="res://asset/art/little_game/自动枯萎的花/花.png" id="2_h4yj5"]
[ext_resource type="Texture2D" uid="uid://crdphnglw5tv8" path="res://asset/art/临时草稿/自动枯萎的花/花.png" id="2_h4yj5"]
[sub_resource type="AtlasTexture" id="AtlasTexture_p73pf"]
atlas = ExtResource("2_h4yj5")

View File

@ -2,7 +2,6 @@
extends Node2D
@export var velocity := 0.1
@export var remote_node: Node2D
@export var area_size := Vector2(400, 50):
set(val):
area_size = val
@ -12,7 +11,11 @@ extends Node2D
gizmo_outline_color = val
queue_redraw()
@onready var sprite_frames := $Sprite2D as Sprite2D
@onready var remote_node := $Node2D
@onready var remote_sprite := %Sprite2D
@onready var sign_mark := %Sign as Sign
var interacted_x = -10000
func _draw() -> void:
@ -34,9 +37,24 @@ var weight := 0.0
func _ready() -> void:
if Engine.is_editor_hint():
return
# init points
for i in range(4):
bezier_points.append(_rand_point())
sign_mark.enabled = visible
sign_mark.interacted.connect(_on_interacted)
visibility_changed.connect(_on_visibility_changed)
interacted_x = ArchiveManager.archive.ground_archive().get_value(
name, "interacted_x", interacted_x
)
if interacted_x > -10000:
remote_node.position = Vector2(interacted_x, area_size.y)
remote_sprite.material = null
func _on_visibility_changed() -> void:
sign_mark.enabled = visible
func _new_point() -> void:
@ -46,6 +64,17 @@ func _new_point() -> void:
bezier_points.append(_rand_point())
func _on_interacted() -> void:
if interacted_x == -10000:
interacted_x = remote_node.position.x
remote_node.position.y = area_size.y
remote_sprite.material = null
ArchiveManager.archive.ground_archive().set_pair(name, "interacted_x", interacted_x)
if GlobalConfig.DEBUG:
print("interacted_x:", interacted_x)
# SceneManager.enable_prop_item("c01_吕萍_记笔记_right")
var _generated_points = -1
@ -91,7 +120,7 @@ func _rand_point() -> Vector2:
# 设置到 remote_transform 的 position 与 rotation
# 速度为 velocity权重为 weight
func _process(delta: float) -> void:
if Engine.is_editor_hint() or not remote_node:
if Engine.is_editor_hint() or not visible or interacted_x > -10000:
return
weight += velocity * delta
if weight >= 1.0:
@ -107,5 +136,5 @@ func _process(delta: float) -> void:
# var p = p1.bezier_interpolate(p0, p3, p2, weight)
remote_node.position = p
# bezier 插值获得角度
remote_node.rotation = lerp_angle(remote_node.rotation, p1.angle_to(p2), delta)
remote_node.skew = -remote_node.rotation * 0.5
remote_sprite.rotation = lerp_angle(remote_sprite.rotation, p1.angle_to(p2), delta)
remote_sprite.skew = -remote_sprite.rotation * 0.5

View File

@ -1,8 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://cn1ypquvs07wx"]
[gd_scene load_steps=9 format=3 uid="uid://cn1ypquvs07wx"]
[ext_resource type="Script" path="res://scene/ground/script/c01/s12_飘动的寻人启事.gd" id="1_like6"]
[ext_resource type="Shader" path="res://asset/shader/rotation_displacement_vertex.gdshader" id="2_2w1m2"]
[ext_resource type="Texture2D" uid="uid://c6vi6umco6o0a" path="res://asset/art/临时草稿/c01_序章/纸片_正面.png" id="3_dl751"]
[ext_resource type="PackedScene" uid="uid://c4tipnj1cr1j3" path="res://scene/entity/ux/sign.tscn" id="4_5dshd"]
[ext_resource type="Texture2D" uid="uid://b343nvvbtpglb" path="res://asset/art/ui/互动提示符/ui 像素版_纯白.png" id="5_tf5lq"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_q4vn8"]
shader = ExtResource("2_2w1m2")
@ -10,13 +12,41 @@ shader_parameter/center = Vector2(25, 25)
shader_parameter/amplitude = 0.15
shader_parameter/frequency = 1.5
[node name="S12" type="Node2D" node_paths=PackedStringArray("remote_node")]
[sub_resource type="AtlasTexture" id="AtlasTexture_lhyxr"]
atlas = ExtResource("5_tf5lq")
region = Rect2(498, 555, 51, 54)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_btxl6"]
size = Vector2(20, 10)
[node name="飘动的寻人启事" type="Node2D"]
position = Vector2(43, 96)
script = ExtResource("1_like6")
velocity = 0.4
remote_node = NodePath("Sprite2D")
area_size = Vector2(500, 150)
[node name="Sprite2D" type="Sprite2D" parent="."]
[node name="Node2D" type="Node2D" parent="."]
[node name="Sprite2D" type="Sprite2D" parent="Node2D"]
unique_name_in_owner = true
material = SubResource("ShaderMaterial_q4vn8")
scale = Vector2(0.4, 0.4)
texture = ExtResource("3_dl751")
[node name="Sign" parent="Node2D" instance=ExtResource("4_5dshd")]
unique_name_in_owner = true
offset_left = 4.0
offset_top = 11.0
offset_right = 4.0
offset_bottom = 11.0
[node name="Sprite2D" parent="Node2D/Sign/TextureContainer" index="0"]
position = Vector2(-25, -162.5)
texture = SubResource("AtlasTexture_lhyxr")
[node name="Area2D" type="Area2D" parent="Node2D"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Node2D/Area2D"]
shape = SubResource("RectangleShape2D_btxl6")
[editable path="Node2D/Sign"]

View File

@ -241,10 +241,12 @@ func _success() -> void:
# 完成后释放信号
$"生死簿".finished.connect(_on_success_finished)
# 生死簿阅读完成后
func _on_success_finished() -> void:
success.emit()
# exit
# exiting.emit()
success.emit()
get_parent().remove_child(self)
@ -252,5 +254,6 @@ func _unhandled_input(event: InputEvent) -> void:
# 阻塞输入
get_viewport().set_input_as_handled()
if event.is_action_pressed("cancel"):
if not gameover:
exiting.emit()
get_parent().remove_child(self)

View File

@ -95,5 +95,7 @@ var ANIMATION_CONFIG = {
MOVEMENT_RUNNING: [&"c01_小小蝶_running_l", &"c01_小小蝶_running_r"],
# animation_name, left, right
ACTION_LOOKUP_WALL: [&"", Vector2.ONE, Vector2(0, -37.0), &"c01_小小蝶_抬头_l", &"c01_小小蝶_抬头_r"],
# 看向橱柜c01_s07 书店外)
5: [&"", Vector2.ONE, Vector2(0, -37.0), &"c01_小小蝶_抬头_l", &"c01_小小蝶_抬头_r"]
},
}