> 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/flag-tag.md).

# 夺旗游戏

具有限时回合、持久化排行榜、复用投射物以及基于距离的光照预算的多人躲避游戏。

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

一款全天候运行的多人服务器抢旗游戏。玩家在每轮五分钟的比赛中争夺旗帜，并使用回旋镖和香蕉陷阱；持久化的每日、每月和总排行榜会记录比赛结果。

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

## 项目信息

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

[查看上游源代码](https://github.com/iillee/flagtag)

**许可证：** 此目录中未标明许可证。重用前，请查阅上游代码库并咨询维护者，确认适用条款。

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

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

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

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

## 主要功能

* 多人服务器
* 用于存储玩家进度和解锁内容
* 为自定义动画遮罩化身

## 探索代码

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

### 按模型变体复用投射物视觉效果

投射物池会为每种颜色的回旋镖预先创建十个隐藏实体。获取和释放辅助函数会查找可用实体，并在停止其音效后将其放回隐藏位置。

**项目背景：** 飞行代码必须设置已获取实体的位置，并在使用完毕后将其归还；该对象池依赖项目中的回旋镖资源和音效辅助函数。

**源代码参考：**

* [投射物池](https://github.com/iillee/flagtag/blob/d5d9c8fbf0f69eadb4d79c3ae4054e8947f256b6/src/systems/projectile/pool.ts#L11-L37)
* [获取和释放辅助函数](https://github.com/iillee/flagtag/blob/d5d9c8fbf0f69eadb4d79c3ae4054e8947f256b6/src/systems/projectile/pool.ts#L48-L66)

### 限制玩家周围的活动灯光数量

proximityLightSystem 会定期进行检查，使用平方距离比较和可复用数组选出最近的灯光，并且只更改活动状态不同的灯光。场景将活动灯光数量上限设为八盏，并通过昼夜辅助函数控制其启用状态。

**项目背景：** 阅读同一文件中的设置和常量，了解世界坐标转换以及针对不同设备设置的强度。

**源代码参考：**

* [proximityLightSystem](https://github.com/iillee/flagtag/blob/d5d9c8fbf0f69eadb4d79c3ae4054e8947f256b6/src/systems/proximityLights.ts#L109-L168)


---

# 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/flag-tag.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.
