# How can I make my sprites destroy once they move off the tilemap?

**URL:** <https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602>\
**Category:** Help\
**Tags:** game, make\
**Created:** [October 23, 2023, 5:01pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602 "2023-10-23T17:01:53Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![SlumpmassigKodare](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/slumpmassigkodare/32/11481_2.png) [@SlumpmassigKodare](https://forum.makecode.com/u/SlumpmassigKodare)\
**Post date:** [October 23, 2023, 5:01pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/1 "2023-10-23T17:01:53Z")

</div>

The game i have been working on recently has been getting laggy bc my sprites stack up out of screen/tilemap. i am trying to figure out how to make them destroy after they move behind the right wall, but i need help.

---

<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:** [October 23, 2023, 5:10pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/2 "2023-10-23T17:10:14Z")

</div>

You can use the `mySprite auto destroy on/off` block to make the sprites destroy when they leave the screen.

---

<div class="post-metadata">

**Author:** ![SlumpmassigKodare](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/slumpmassigkodare/32/11481_2.png) [@SlumpmassigKodare](https://forum.makecode.com/u/SlumpmassigKodare)\
**Post date:** [October 24, 2023, 4:30pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/3 "2023-10-24T16:30:49Z")

</div>

I know that, but i don’t know how to tell it when and where to destroy. They need to destroy once they move outside 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:** [October 24, 2023, 4:40pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/4 "2023-10-24T16:40:35Z")

</div>

Well, if your tilemap is completely filled with tiles, then you can set an `on sprite overlap with 'transparent' tile` event and set the sprite to destroy.

---

<div class="post-metadata">

**Author:** ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)\
**Post date:** [October 26, 2023, 9:41pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/5 "2023-10-26T21:41:37Z")

</div>

Did you know code of conduct is an acronym for coc

---

<div class="post-metadata">

**Author:** ![DangerNoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dangernoodle/32/14797_2.png) [@DangerNoodle](https://forum.makecode.com/u/DangerNoodle)\
**Post date:** [October 27, 2023, 6:11pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/6 "2023-10-27T18:11:35Z")

</div>

why.why. WHYYYYYYYYYY OF GOD FRIGGIN WHY

---

<div class="post-metadata">

**Author:** ![SlumpmassigKodare](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/slumpmassigkodare/32/11481_2.png) [@SlumpmassigKodare](https://forum.makecode.com/u/SlumpmassigKodare)\
**Post date:** [October 27, 2023, 11:52pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/7 "2023-10-27T23:52:49Z")

</div>

Thanks, Blobbey! That should work.

---

<div class="post-metadata">

**Author:** ![DangerNoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dangernoodle/32/14797_2.png) [@DangerNoodle](https://forum.makecode.com/u/DangerNoodle)\
**Post date:** [October 30, 2023, 5:34pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/9 "2023-10-30T17:34:42Z")

</div>

Hehehehe

I’m always watching…

---

<div class="post-metadata">

**Author:** ![Mega0star01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mega0star01/32/14784_2.png) [@Mega0star01](https://forum.makecode.com/u/Mega0star01)\
**Post date:** [October 30, 2023, 5:57pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/10 "2023-10-30T17:57:35Z")

</div>

man i don’t have a closet.

---

<div class="post-metadata">

**Author:** ![Mega0star01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mega0star01/32/14784_2.png) [@Mega0star01](https://forum.makecode.com/u/Mega0star01)\
**Post date:** [October 30, 2023, 9:44pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/12 "2023-10-30T21:44:26Z")

</div>

Yep, my room doesn’t have a closet so my clothes are in other room with closet.

---

<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:** [October 31, 2023, 3:46pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/13 "2023-10-31T15:46:46Z")

</div>

I’m glad I was able to help!

---

<div class="post-metadata">

**Author:** ![ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@ethan](https://forum.makecode.com/u/ethan)\
**Post date:** [December 20, 2023, 6:29pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/14 "2023-12-20T18:29:38Z")

</div>

my closet cant even hold a feather without breaking

---

<div class="post-metadata">

**Author:** ![robotosaurus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/robotosaurus/32/19294_2.png) [@robotosaurus](https://forum.makecode.com/u/robotosaurus)\
**Post date:** [January 5, 2024, 5:25pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/15 "2024-01-05T17:25:23Z")

</div>

As far as i’m concerned your not in my closet. And how would you be in multiple people closet at the same time?

---

<div class="post-metadata">

**Author:** ![DangerNoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dangernoodle/32/14797_2.png) [@DangerNoodle](https://forum.makecode.com/u/DangerNoodle)\
**Post date:** [January 5, 2024, 7:13pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/16 "2024-01-05T19:13:17Z")

</div>

Celluar Splitting

---

<div class="post-metadata">

**Author:** ![robotosaurus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/robotosaurus/32/19294_2.png) [@robotosaurus](https://forum.makecode.com/u/robotosaurus)\
**Post date:** [January 8, 2024, 7:02pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/17 "2024-01-08T19:02:12Z")

</div>

That only works for single cell organizations.

---

<div class="post-metadata">

**Author:** ![DangerNoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dangernoodle/32/14797_2.png) [@DangerNoodle](https://forum.makecode.com/u/DangerNoodle)\
**Post date:** [January 8, 2024, 7:19pm UTC](https://forum.makecode.com/t/how-can-i-make-my-sprites-destroy-once-they-move-off-the-tilemap/23602/18 "2024-01-08T19:19:24Z")

</div>

Nuh uh
