# Changing Tilemaps

**URL:** <https://forum.makecode.com/t/changing-tilemaps/19846>\
**Category:** Help\
**Created:** [May 11, 2023, 9:16pm UTC](https://forum.makecode.com/t/changing-tilemaps/19846 "2023-05-11T21:16:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdf1](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sdf1](https://forum.makecode.com/u/sdf1)\
**Post date:** [May 11, 2023, 9:16pm UTC](https://forum.makecode.com/t/changing-tilemaps/19846/1 "2023-05-11T21:16:28Z")

</div>

I’m trying to change the tilemap after each game, but it isn’t working. I have a variable called mapNumber, and whenever someone dies, mapNumber increases by 1. Each number that mapNumber is corresponds to a different tilemap. However, it isn’t working. Why?

> **[Super Smash Bros Ripoff](https://arcade.makecode.com/S09887-77711-45591-34994)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [May 11, 2023, 11:34pm UTC](https://forum.makecode.com/t/changing-tilemaps/19846/2 "2023-05-11T23:34:36Z")

</div>

The reason that the tilemap’s not changing is because you’re making the game end, which displays the game over screen, and then resets the game (and all variables along with it).

---

<div class="post-metadata">

**Author:** ![sdf1](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sdf1](https://forum.makecode.com/u/sdf1)\
**Post date:** [May 12, 2023, 11:18pm UTC](https://forum.makecode.com/t/changing-tilemaps/19846/3 "2023-05-12T23:18:35Z")

</div>

Is there any way to fix this issue? If not, is there a different method I can use instead of incrementing a variable to change the tilemap?

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [May 15, 2023, 3:36am UTC](https://forum.makecode.com/t/changing-tilemaps/19846/4 "2023-05-15T03:36:22Z")

</div>

You could use the settings extension. I can post pictures later.

---

<div class="post-metadata">

**Author:** ![Samsano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/samsano/32/8307_2.png) [@Samsano](https://forum.makecode.com/u/Samsano)\
**Post date:** [May 15, 2023, 3:38am UTC](https://forum.makecode.com/t/changing-tilemaps/19846/5 "2023-05-15T03:38:38Z")

</div>

> [@Blobbey](#):
>
> The reason that the tilemap’s not changing is because you’re making the game end, which displays the game over screen, and then resets the game (and all variables along with it).

As Blobbey said, you are resetting the game when you display the game over screen. You need to display something on your own so that the variables doesen’t get reset. **Or you can use the settings extension, which saves your variables.**

Hope it helps!

---

<div class="post-metadata">

**Author:** ![labfox29](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/labfox29/32/9252_2.png) [@labfox29](https://forum.makecode.com/u/labfox29)\
**Post date:** [May 15, 2023, 4:07pm UTC](https://forum.makecode.com/t/changing-tilemaps/19846/6 "2023-05-15T16:07:16Z")

</div>

Use the settings extension to save some variables.
