添加玩家逻辑
每个玩家的状态
Player :: class : Player_Base {
health: int;
inventory_open: bool;
}服务器 + 客户端:哪些内容在哪儿运行?
Player :: class : Player_Base {
ao_late_update :: method(dt: float) {
if is_local_or_server() {
// 在这里绘制所有玩家 UI 并处理其输入。
}
if is_local() {
// 在这里应用仅对玩家生效的可见性,但不要更改字段。
}
}
}玩家身份和资料数据
持久化:将玩家进度存储在哪里
常见模式:在 ao_start
最佳实践
Player_Base 参考
最后更新于