# Sprites still overlap after being destroyed

**URL:** <https://forum.makecode.com/t/sprites-still-overlap-after-being-destroyed/7668>\
**Category:** Arcade\
**Created:** [April 28, 2021, 12:33am UTC](https://forum.makecode.com/t/sprites-still-overlap-after-being-destroyed/7668 "2021-04-28T00:33:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeardedCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/beardedcoder/32/4039_2.png) [@BeardedCoder](https://forum.makecode.com/u/BeardedCoder)\
**Post date:** [April 28, 2021, 12:33am UTC](https://forum.makecode.com/t/sprites-still-overlap-after-being-destroyed/7668/1 "2021-04-28T00:33:57Z")

</div>

Hi, I’ve started making a game where you can interact with other sprites by pressing the A key. I noticed that when I changed the scene and destroyed a sprite that was no longer needed, I was still able to interact with the destroyed sprite in the new scene. You can see what I have so far here: [https://makecode.com/\_EpeKoViHwRUL](https://makecode.com/_EpeKoViHwRUL)

In the code you’ll see I have “on A button pressed” with a set of conditions. The first condition is for when you’re overlapping with mySprite2 (to talk to the NPC in the first scene). The second condition is for when you’re overlapping the brown door tile, and the first block in that condition destroys mySprite2. In the second scene though, if you move to the location of where the NPC used to be (just a bit below and to the right of the centre) and press A, the first condition is somehow still able to be true.

I don’t see any other blocks that would remove sprites and the help info for the destroy block even says “The sprite is removed from the game and will no longer overlap or collide with any other sprites.”

Is it a bug with the destroy block or is there something else in my code causing the issue?

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [April 28, 2021, 12:51am UTC](https://forum.makecode.com/t/sprites-still-overlap-after-being-destroyed/7668/2 "2021-04-28T00:51:08Z")

</div>

Ah, looks like that one is currently just checking for if a sprite is a ghost and not if it is destroyed. If you set ‘ghost through sprites’ when destroying it for now it will work, I’ll fix it for the next release though. (Using the on overlap event will work as well~)

fix here: [https://github.com/microsoft/pxt-common-packages/pull/1251/files](https://github.com/microsoft/pxt-common-packages/pull/1251/files)

---

<div class="post-metadata">

**Author:** ![BeardedCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/beardedcoder/32/4039_2.png) [@BeardedCoder](https://forum.makecode.com/u/BeardedCoder)\
**Post date:** [April 28, 2021, 3:49pm UTC](https://forum.makecode.com/t/sprites-still-overlap-after-being-destroyed/7668/3 "2021-04-28T15:49:44Z")

</div>

That’s great, thanks for the quick fix! We’re starting a course with a group of 9-12 year olds soon to build their own games, so I’ll make sure we don’t teach them about overlap until that release comes out 😉

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [April 30, 2021, 11:51pm UTC](https://forum.makecode.com/t/sprites-still-overlap-after-being-destroyed/7668/4 "2021-04-30T23:51:24Z")

</div>

Fix is released in v1.4.41 as of a few minutes ago 🙂
