> 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/tutorials-and-examples/published-games/tower-of-madness.md).

# Tower of Madness

Timed platforming through changing tower sections, with asset preloading and a skippable camera tour of the level.

![Tower of Madness preview](https://45449780-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-216f5a3735ed2477e2b58bace71288cf6e0840a5%2F4c85255e-c1db-48f0-8e0f-35dec36f3ab0-1792498908.webp?alt=media)

A timed platforming game where players race to reach the top.

* [Play on Decentraland](https://decentraland.org/jump?realm=towerofmadness.dcl.eth)

## Project information

**Maintained by:** Decentraland DAO

[View source](https://github.com/dcl-regenesislabs/towerofmadness)

**License:** Not identified in this catalog. Consult the upstream repository and maintainer for applicable terms before reuse.

## Explore the code

These links point to a specific source snapshot so the explanations remain useful as upstream development continues. They are learning references, not a security assessment.

### Preload the pieces of a changing level

`setupChunkPreload` deduplicates the chunk asset paths and creates temporary GLTF entities. A system watches their loading states, removes entities after loading completes or fails, and unregisters itself when none remain.

**Project context:** This illustrates managing a preload lifecycle; the asset list comes from `shared/chunks` and is specific to the tower.

**Source references:**

* [`setupChunkPreload`](https://github.com/dcl-regenesislabs/towerofmadness/blob/be318c6f0a287c15f3771f12f629b84de6cc18af/src/chunkPreload.ts#L22-L61)

### Build a skippable camera tour around changing geometry

`playCinematic` adjusts camera keyframes around the current start and end chunks, then selects a virtual camera. The update system interpolates position and look-at targets and supports holding a button to skip.

**Project context:** Follow the chunk lookup helpers and `skipCinematic` to see how the tour finds its anchors and returns control to the player camera.

**Source references:**

* [`playCinematic`](https://github.com/dcl-regenesislabs/towerofmadness/blob/be318c6f0a287c15f3771f12f629b84de6cc18af/src/cinematicCamera.ts#L110-L209)
* [update system](https://github.com/dcl-regenesislabs/towerofmadness/blob/be318c6f0a287c15f3771f12f629b84de6cc18af/src/cinematicCamera.ts#L286-L334)


---

# 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/tutorials-and-examples/published-games/tower-of-madness.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.
