98 lines
3.6 KiB
Markdown
98 lines
3.6 KiB
Markdown
# xiandie
|
||
|
||
《衔蝶》开发代码
|
||
|
||
# 说明
|
||
|
||
- animation frames:res://config/animation/entity_sprite_frames.tres
|
||
|
||
## 插件
|
||
|
||
- [DialogueManager 使用与维护说明](https://docs.qq.com/doc/DWG5vaEZ1Qk9EdVVw)
|
||
- [GIF 插件](https://godotengine.org/asset-library/asset/2255)
|
||
|
||
### ProAnimatedSprite2D
|
||
|
||
插件路径:addons/property-inspector/pro_animation_sprite2d
|
||
|
||

|
||
|
||
ProAnimatedSprite2D,增强 AnimatedSprite2D 的表现,在其基础上增加:
|
||
|
||
1. 播放+移动:播放特定动画时自动移动,可配置移速
|
||
2. 播放某动画后自动跳转:播放一个动画结束后,自动播放另一个
|
||
3. 自动跳转可以设置循环播放次数,若干次后再跳转
|
||
4. 跳转前可以等待 wait_time 时长
|
||
|
||
其中:
|
||
|
||
1. action configs 配置动画跳转逻辑
|
||
2. move configs 配置播放特定动画时的移动速度
|
||
3. ProAnimatedSprite2D 配置项跳过保存默认值,有利于统一控制、变更默认值
|
||
|
||
## Ground 与 GroundLoader
|
||
|
||
- 正常游戏:Main -> GroundLoader -> Ground
|
||
- 开发阶段:直接编辑 Ground
|
||
|
||
### Ground 说明
|
||
|
||
#### AnimationPlayer:每个 Ground 都有一个 AnimationPlayer,脚本继承自定义的 AnimationRoot
|
||
|
||
主要功能说明:
|
||
|
||
1. 正常的 AnimationPlayer 功能
|
||
2. oneshot_animation 场景首次加载时播放的 animation
|
||
|
||
主要方法与数据说明:
|
||
|
||
1. _default_data() : 本场景的默认存档数据
|
||
2. _on_ground_ready(): 在父节点 Ground 加载完成后回调
|
||
3. set_data(property: StringName, value: Variant):用于设置需要存档的数据
|
||
4. ground_archive:存档数据
|
||
|
||
#### Entity 说明
|
||
|
||
位置:res://scene/entity/
|
||
|
||
子目录说明:
|
||
|
||
1. ambient:光照
|
||
2. general:音效等
|
||
3. partical:粒子效果
|
||
4. ux:用户交互
|
||
|
||
主要类型说明:
|
||
|
||
1. ambush:触发区域,触发后执行回调
|
||
1. 可以配置是否一次性
|
||
2. 可配置触发方式:enter, area_enter, interact
|
||
3. 可在场景加载时触发
|
||
4. 触发效果有:播放对话(期间锁定玩家);播放动画;回调方法(AnimationPlayer 的方法,注意“_”开头的方法会被忽略)
|
||
2. inspectable:可在检阅窗口进行审视的物品,可以附加文案
|
||
3. local_inspectable:运镜+检阅,无需检阅窗口
|
||
4. note:显示文案
|
||
1. 显示方式:os(玩家头顶气泡),ballon(下方字幕,可播放配音)
|
||
5. npc
|
||
6. portal:传送门
|
||
1. 名称有: left(默认), right(默认), 1, 2, 3, ...
|
||
2. 关键参数:targer_scene 与 target_portal(target_portal 为 none 时不启用)
|
||
3. 三种模式:default(通道);opened(打开的门);locked(锁定的门);对应不同图标与操作音效
|
||
4. 锁定的门可以配置启用钥匙(prop_key),可在使用后自动消耗该钥匙
|
||
|
||
|
||
## 存档结构
|
||
|
||
- 存档命名为:"save"+三位数字
|
||
- 如果不足三位数字,则会忽略;超过三位数字不会忽略,可以正常读取
|
||
- 这是为了方便多存档功能进行文本排序等
|
||
- 开发阶段 debug 存档:save000
|
||
- 开发阶段 index 页面进入的游戏存档:save001
|
||
- 发行后,玩家游戏过程中,自动保存的存档编号范围(最多 10 个,循环保存):000-019
|
||
- 发行后,玩家游戏过程中,手动保存的存档编号范围(最多 10 个栏位):050-059
|
||
- 发行后,玩家游戏过程中最多有以上 20 个存档
|
||
|
||
每个场景都有一份 GroundArchive 存档,通过 ArchiveManager.archive.ground_archive() 可以获得。
|
||
|
||
current_scene 是通过 GroundLoader 加载的,在 ground loader 加载 ground 时,会先更新 archive 的 current scene,然后加载 ground。
|