# How do I set a type of tile to be always a wall

**URL:** <https://forum.makecode.com/t/how-do-i-set-a-type-of-tile-to-be-always-a-wall/23680>\
**Category:** Help\
**Created:** [October 26, 2023, 5:29pm UTC](https://forum.makecode.com/t/how-do-i-set-a-type-of-tile-to-be-always-a-wall/23680 "2023-10-26T17:29:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vampire-Squid12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vampire-squid12/32/11419_2.png) [@Vampire-Squid12](https://forum.makecode.com/u/Vampire-Squid12)\
**Post date:** [October 26, 2023, 5:29pm UTC](https://forum.makecode.com/t/how-do-i-set-a-type-of-tile-to-be-always-a-wall/23680/1 "2023-10-26T17:29:57Z")

</div>

I am making a top down procedurally generated shooter game I do not no how to make a type of tile only be a wall.

---

<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:** [October 26, 2023, 7:44pm UTC](https://forum.makecode.com/t/how-do-i-set-a-type-of-tile-to-be-always-a-wall/23680/2 "2023-10-26T19:44:08Z")

</div>

You can do it manually in the tile editor or you can run this bit of code every time you load a tile map:

For element (value) of (array of all(The tile you want) locations):  
Set wall at (value)

You can find the “for element” block in the loops tab.  
Hope this helps!

---

<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:** [October 26, 2023, 8:00pm UTC](https://forum.makecode.com/t/how-do-i-set-a-type-of-tile-to-be-always-a-wall/23680/3 "2023-10-26T20:00:59Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/cb600645c7ce074e8ea230425385bfb3d1c8a692.png)

I have coded this roughly a million times ^

Here’s the code:

> **[set-walls-on](https://arcade.makecode.com/S61424-47795-72845-86195)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I’ve also finally opened a PR to add this to the tile util extension:

> <https://github.com/microsoft/arcade-tile-util/pull/3>
>
> !\[image\](https://github.com/microsoft/arcade-tile-util/assets/13754588/a6f493d3-…54e7-4e46-a926-bf17cd892d4e)
> 
> 
> Adds a single block to this extension that lets you set walls on/off for all tiles with a given image. I have coded this roughly a million times on stream and we also have people asking for it on the forum:
> 
> https://forum.makecode.com/t/how-do-i-set-a-type-of-tile-to-be-always-a-wall/23680/2

---

<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:** [October 26, 2023, 8:27pm UTC](https://forum.makecode.com/t/how-do-i-set-a-type-of-tile-to-be-always-a-wall/23680/4 "2023-10-26T20:27:11Z")

</div>

…and merged! There is now a block for this in the arcade-tile-util extension:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/d4861dfefae28ddfc5c0d135a8bc02e0821b08f2.png)

It’s at the bottom of the “tiles” section:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/8ceffac16f0899ea26f0dc2545490376bda55391.png)

---

<div class="post-metadata">

**Author:** ![Vampire-Squid12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vampire-squid12/32/11419_2.png) [@Vampire-Squid12](https://forum.makecode.com/u/Vampire-Squid12)\
**Post date:** [November 15, 2023, 5:53pm UTC](https://forum.makecode.com/t/how-do-i-set-a-type-of-tile-to-be-always-a-wall/23680/5 "2023-11-15T17:53:12Z")

</div>

thank you
