> 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/my-dear-pet.md).

# 我亲爱的宠物

宠物收集玩法，移动带有加速与刹车效果，并对编辑器放置的蛋进行相位偏移动画。

![《My Dear Pet》预览](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-b6289ca5d2923914fc0440e665f86bdde0856432%2FmyDearPet-preview.webp?alt=media)

一款收集宠物的游戏。

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

## 项目信息

**维护者：** Decentraland DAO

[查看源代码](https://github.com/dcl-regenesislabs/marsh-colony)

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

## 探索代码

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

### 为移动中的宠物添加加速和制动

`petMotionStep` 会为每个实体记录速度，根据剩余制动距离限制目标速度，并返回适用于一帧的移动步长。调用方仍需提供路线并更新变换。

**项目背景：** 研究此辅助函数的移动效果时，请同时查看 `shared/config` 中的到达距离、加速度和制动参数。

**源代码参考：**

* [`petMotionStep`](https://github.com/dcl-regenesislabs/marsh-colony/blob/55dea4d3e13b3d821aa20bd277fbc4e0bc920b6f/src/client/petMotion.ts#L9-L35)

### 让编辑器中放置的道具按不同相位进行动画

`setupEggShake` 会查找命名的蛋实体，记录它们的初始旋转，并为每个蛋设置不同的相位，以施加轻微的正弦波旋转。这样既能增添变化，也能保留每个道具在场景中的原始朝向。

**项目背景：** 它依赖于根据 Creator Hub 场景生成的蛋名称。

**源代码参考：**

* [`setupEggShake`](https://github.com/dcl-regenesislabs/marsh-colony/blob/55dea4d3e13b3d821aa20bd277fbc4e0bc920b6f/src/client/eggShake.ts#L29-L53)


---

# 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/my-dear-pet.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.
