> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-zh/jiao-cheng-yu-shi-li/published-games/fastlane-bowling.md).

# 快线保龄球

采用服务器模拟物理、持久化进度、批量状态更新和适配移动端粒子效果的多人保龄球。

![Fastlane Bowling 预览](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-2adc89dbcdaf0de2fb3fbff3504bc414dbf633a6%2FfastlaneBowling-preview.webp?alt=media)

一款多人保龄球游戏，使用 Cannon-ES 提供的逼真物理效果。多个游戏可在共享空间中的不同球道上同时进行。

* [在 Decentraland 上游玩](https://decentraland.org/jump?realm=stom.dcl.eth)

## 项目信息

**维护者：** 社区 · stom66

[查看上游源代码](https://github.com/stom66/dcl-bowling)

**许可证：** [CC BY-NC-ND 4.0](https://github.com/stom66/dcl-bowling/blob/main/LICENSE.md)。重复使用前请查看上游条款；代码和素材可能适用不同条款。

{% hint style="warning" %}
**社区维护的代码——使用前请先审查**

此社区项目由 Decentraland Foundation 和 DAO 的 GitHub 组织之外的人员维护。其源代码和线上部署可能独立发生变化。

此项目被收录于本目录，并不代表它已通过安全审计或保证其安全性。运行或复用前，请审查代码、依赖项和安装脚本。

[报告目录相关问题](https://github.com/decentraland/docs/issues/new)。如怀疑存在漏洞，请遵循上游项目的安全政策。请勿在公开议题中包含漏洞利用细节或凭据。
{% endhint %}

## 主要功能

* [**Cannon-ES**](https://github.com/pmndrs/cannon-es) **物理模拟** 在多人游戏服务器上运行，客户端通过重放压缩关键帧来还原过程。
* **存储** 用于保存玩家进度、统计数据、偏好设置、物品栏，以及每周和总榜排行榜。
* 动态 **灯光** 包含旋转的阴影遮罩，以及跟随保龄球移动的聚光灯。
* **粒子** 轨迹和解锁特效，并在移动设备上减少粒子数量。
* **虚拟摄像机** 用于入场飞行动画、瞄准和滚球回放。
* **`GltfNodeModifiers`** 用于滚动霓虹纹理的 UV 坐标。
* 由 SDK 控制的 **glTF 动画** 用于球道护栏、倒计时和得分特效。

## 探索代码

这些链接指向特定的源代码快照，因此随着上游持续开发，这些说明仍然有用。它们是学习参考资料，并非安全评估。

### 将同步状态变更批量处理为客户端事件

在 `LaneWatcher.onLaneChanged`中，一个集合会收集发生变更的球道，并安排一次统一刷新。 `flush` 会读取每条球道的快照，并发出状态事件和阶段转换事件。顺着这一流程，可以了解场景如何将同步组件连接到客户端响应。

**项目背景：** 请结合项目的 `LaneStore` 和事件总线定义一起阅读。

**源代码参考：**

* [`LaneWatcher.onLaneChanged`](https://github.com/stom66/dcl-bowling/blob/25c5a7f9152835c190d9d20fa18b6010d0c6ce50/dcl/src/client/laneWatcher.ts#L79-L90)
* [`flush`](https://github.com/stom66/dcl-bowling/blob/25c5a7f9152835c190d9d20fa18b6010d0c6ce50/dcl/src/client/laneWatcher.ts#L132-L153)

### 针对移动设备调整粒子特效

`getParticleRatio` 和 `scaleConfig` 会根据移动设备比例调整发射速率、粒子数量上限和爆发数量，同时保留原始配置。 `spawn` 会将该配置应用于新发射器，并可选择设置父级对象和定时清理。

**项目背景：** 研究如何让同一份特效配置适用于不同设备时，这部分内容会很有帮助。

**源代码参考：**

* [`getParticleRatio` 和 `scaleConfig`](https://github.com/stom66/dcl-bowling/blob/25c5a7f9152835c190d9d20fa18b6010d0c6ce50/dcl/src/client/particleSpawner.ts#L176-L218)
* [`spawn`](https://github.com/stom66/dcl-bowling/blob/25c5a7f9152835c190d9d20fa18b6010d0c6ce50/dcl/src/client/particleSpawner.ts#L91-L121)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-zh/jiao-cheng-yu-shi-li/published-games/fastlane-bowling.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
