> 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/prime-drive.md).

# 竞速之巅

三车道竞速，配有循环复用的场景、基于距离的记录幽灵和持久化排行榜数据。

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

一款三车道自行车竞速游戏，玩家需要躲避障碍、收集金币，并在 10 公里的赛道上追赶赛道纪录幽灵。

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

## 项目信息

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

[查看上游源代码](https://github.com/carlosmu/dcl-prime-drive)

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

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

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

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

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

## 探索代码

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

### 利用循环复用的景物打造长距离竞速

`setWorldOffset` 和 `scrollTrack` 会让共享世界根节点横向移动以切换车道，并在道路装饰物经过玩家后将其循环移回前方。自行车保持不动，由景物营造出移动感。

**项目背景：** 阅读环形赛道的构建器和共享的 `TRACK`/`SPAWN` 设置，以了解间距和循环距离。

**源代码参考：**

* [`setWorldOffset` 和 `scrollTrack`](https://github.com/carlosmu/dcl-prime-drive/blob/d3767141bc39ccef031e56ff9640592ecb349645/src/client/game/track.ts#L43-L92)

### 相对于玩家显示纪录幽灵

`updateGhosts` 根据距离差放置幽灵自行车，在幽灵超出视野范围时将其隐藏，并让它们平滑地移动到远离玩家的车道。

**项目背景：** 此模块使用 `GhostRunView` 数据；它只显示提供的进度，本身不会录制回放。

**源代码参考：**

* [`updateGhosts`](https://github.com/carlosmu/dcl-prime-drive/blob/d3767141bc39ccef031e56ff9640592ecb349645/src/client/game/ghost.ts#L129-L183)


---

# 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/prime-drive.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.
