# Tilemaps causing lag?

**URL:** <https://forum.makecode.com/t/tilemaps-causing-lag/43322>\
**Category:** Help\
**Tags:** game\
**Created:** [April 14, 2026, 4:35pm UTC](https://forum.makecode.com/t/tilemaps-causing-lag/43322 "2026-04-14T16:35:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [April 14, 2026, 4:35pm UTC](https://forum.makecode.com/t/tilemaps-causing-lag/43322/1 "2026-04-14T16:35:39Z")

</div>

@richard in a new BARRIER team game, we’re trying to make levels that connect to each other; essentially you run outside of the edge of one tilemap and you reappear on the other side of the other one (like in Shovel Knight, Pizza Tower, Hollow Knight, etc). Everything works well, but the more times you transition between tilemaps, the laggier it gets. Is this some kind of `tiles.TileMapData` issue, or something else? thanks in advance.

---

<div class="post-metadata">

**Author:** ![Astro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astro/32/35479_2.png) [@Astro](https://forum.makecode.com/u/Astro)\
**Post date:** [April 14, 2026, 5:41pm UTC](https://forum.makecode.com/t/tilemaps-causing-lag/43322/2 "2026-04-14T17:41:03Z")

</div>

are you creating any sprites during the transition?

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [April 14, 2026, 5:41pm UTC](https://forum.makecode.com/t/tilemaps-causing-lag/43322/3 "2026-04-14T17:41:28Z")

</div>

Are you using Richard’s tilemap transitions extension or are you doing it yourself? I can imagine an issue where every tilemap stays loaded after you leave it for some reason or another. That might even be an intended feature.

---

<div class="post-metadata">

**Author:** ![not\_a\_lemon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/not_a_lemon/32/35289_2.png) [@not\_a\_lemon](https://forum.makecode.com/u/not_a_lemon)\
**Post date:** [April 14, 2026, 11:31pm UTC](https://forum.makecode.com/t/tilemaps-causing-lag/43322/4 "2026-04-14T23:31:37Z")

</div>

> [@Astro](#):
>
> are you creating any sprites during the transition?

No, I use a system to detect where you are in the tilemaps and swap levels when you hit an edge.

> [@WoofWoof](#):
>
> Are you using Richard’s tilemap transitions extension or are you doing it yourself?

I’m doing it myself.

> [@WoofWoof](#):
>
> I can imagine an issue where every tilemap stays loaded after you leave it for some reason or another.

This I don’t know about… my maps have a LOT of transparent tiles in different places and they don’t show any other tiles behind them… but if the transparent tiles also look through the tilemaps behind it then that’s probably the problem.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [April 15, 2026, 12:16am UTC](https://forum.makecode.com/t/tilemaps-causing-lag/43322/5 "2026-04-15T00:16:46Z")

</div>

i’m going to have to look at your code to determine what’s going on. swapping tilemaps like this shouldn’t inherently cause lag

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [April 15, 2026, 1:16am UTC](https://forum.makecode.com/t/tilemaps-causing-lag/43322/6 "2026-04-15T01:16:35Z")

</div>

Yeah I agree with Richard, please share your project! I have also hand rolled tilemap transitions so I’ll gladly help.

---

<div class="post-metadata">

**Author:** ![Eonmorgan](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@Eonmorgan](https://forum.makecode.com/u/Eonmorgan)\
**Post date:** [April 15, 2026, 8:41pm UTC](https://forum.makecode.com/t/tilemaps-causing-lag/43322/7 "2026-04-15T20:41:56Z")

</div>

> [@not\_a\_lemon](#):
>
> @richard in a new BARRIER team game, we’re trying to make levels that connect to each other; essentially you run outside of the edge of one tilemap and you reappear on the other side of the other one (like in Shovel Knight, Pizza Tower, Hollow Knight, etc). Everything works well, but the more times you transition between tilemaps, the laggier it gets. Is this some kind of `tiles.TileMapData` issue, or something else? thanks in advance.

I think tis performance issue from repeated transitions, possibly tilemaps not being properly unloaded or memory stacking up
