# Destroy wall with projectile

**URL:** <https://forum.makecode.com/t/destroy-wall-with-projectile/1376>\
**Category:** Arcade\
**Created:** [March 11, 2020, 10:25am UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376 "2020-03-11T10:25:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![izno](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@izno](https://forum.makecode.com/u/izno)\
**Post date:** [March 11, 2020, 10:25am UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/1 "2020-03-11T10:25:59Z")

</div>

Hello all,  
I’m trying to remove a wall by shooting it down with no luck… What am I doing wrong?

 ![2020-03-11 11.06.18](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/4fc47a357e4dd866ab242abdfcec6a7837d6b4c3.gif)

Any guidance is appreciated;o)

Thank you in advance  
//A

---

<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:** [March 11, 2020, 5:27pm UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/2 "2020-03-11T17:27:22Z")

</div>

Here’s some sample code:

> **[wall-destroying](https://arcade.makecode.com/24394-83840-79579-53846)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

And here’s the relevant bit:

 ![Screen Shot 2020-03-11 at 10.27.01 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/f449ad84dea25c44abce2b87aead6f1c52431938.png)

---

<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:** [March 11, 2020, 5:31pm UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/3 "2020-03-11T17:31:02Z")

</div>

And if you only want to destroy certain tiles, there’s an easy tweak to the code:

> **[selective-wall-destroying](https://arcade.makecode.com/90892-02339-97663-96165)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![nayrbgo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nayrbgo/32/668_2.png) [@nayrbgo](https://forum.makecode.com/u/nayrbgo)\
**Post date:** [March 11, 2020, 6:49pm UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/4 "2020-03-11T18:49:25Z")

</div>

Love the idea and the help! This is the best forum.

---

<div class="post-metadata">

**Author:** ![izno](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@izno](https://forum.makecode.com/u/izno)\
**Post date:** [March 11, 2020, 10:24pm UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/5 "2020-03-11T22:24:22Z")

</div>

Thanks @richard!

I totally get what you are doing… really clever. However it’s kind of a long way to go for removing a tile that should be just removed if the projectile overlaps it.

Anyways… this forum is amazing and teaching me lots of nifty stuff.

Best regards  
//A

---

<div class="post-metadata">

**Author:** ![codebott578](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codebott578/32/690_2.png) [@codebott578](https://forum.makecode.com/u/codebott578)\
**Post date:** [March 11, 2020, 10:57pm UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/6 "2020-03-11T22:57:54Z")

</div>

good for my future updates! 🙂

---

<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:** [March 11, 2020, 11:34pm UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/7 "2020-03-11T23:34:50Z")

</div>

@izno thanks for the feedback. I agree this is not ideal, I’ve opened an issue for it [here](https://github.com/microsoft/pxt-arcade/issues/1783) with a proposal for a new block.

---

<div class="post-metadata">

**Author:** ![codebott578](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codebott578/32/690_2.png) [@codebott578](https://forum.makecode.com/u/codebott578)\
**Post date:** [March 13, 2020, 9:11pm UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/8 "2020-03-13T21:11:25Z")

</div>

yes! add the new block!!! pls add it!!! 🙂 😆 😆 😆 😁 😁 😁

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [March 15, 2023, 12:49am UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/9 "2023-03-15T00:49:30Z")

</div>

The sprite also can’t overlap the wall you’d have to use if mysprite hitting wall

---

<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:** [March 15, 2023, 6:26pm UTC](https://forum.makecode.com/t/destroy-wall-with-projectile/1376/10 "2023-03-15T18:26:14Z")

</div>

I know this topic already got resolved, but I may have a fix that’s fairly simple. ⬇  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/87e9e79aea51cd2581d47c1a5df15360350b1b2c.png)  
The code wasn’t working because you were using an overlap block, but because the tile was a wall, the projectile wasn’t able to overlap it. The code above typically works for me when I’m using projectiles to remove walls and stuff like that.  
 ![download](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c7ff1fe0aac6f35862617ca8dfe43a516b824b8a.gif)  
This is the code in action.  
I hope this helps.
