> 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). Agents can also search and read this documentation through its [MCP server](https://docs.decentraland.org/~gitbook/mcp).

# 夺旗游戏

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

![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.
