# Destroying entities

**URL:** <https://forum.makecode.com/t/destroying-entities/6004>\
**Category:** Help\
**Created:** [February 6, 2021, 9:20pm UTC](https://forum.makecode.com/t/destroying-entities/6004 "2021-02-06T21:20:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![miders48](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@miders48](https://forum.makecode.com/u/miders48)\
**Post date:** [February 6, 2021, 9:20pm UTC](https://forum.makecode.com/t/destroying-entities/6004/1 "2021-02-06T21:20:54Z")

</div>

Is there a way to destroy all entities of one type (ie projectile) when one comes into contact with the player? I could post the game it’s for if needed

---

<div class="post-metadata">

**Author:** ![DahbixLP](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dahbixlp/32/4760_2.png) [@DahbixLP](https://forum.makecode.com/u/DahbixLP)\
**Post date:** [February 6, 2021, 10:17pm UTC](https://forum.makecode.com/t/destroying-entities/6004/2 "2021-02-06T22:17:23Z")

</div>

Yes! First go into sprite category!  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c3aac14744c3e54f8b8dced014e3f150cdc7f922.png)  
Then scroll down to lifecycle! And get this block!  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/50c8cb9b356a41a16ba25936280c21f685f98b52.png)  
An array is a list of things (Numbers, texts,…) and here the list of all sprite kind player!  
Next go to loops and get this block!  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/8451fa08b855abd14485f154e95b7a4306f2f008.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c9ccf784aa2c4989d267b2b3f757c8307b615b1f.png)  
Then drag the block out and drag the array of sprites kind into the list thing!  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/72149ca5f7f96b901e3ed4403665fd6d4a0ad71c.png)  
(Change the kind to whatever kind to destroy (Food, Players, Enemies, Projectiles…)  
Then drag the destroy block in this loop!  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/024ff7a0eea5b285fe66407975cd744af5d48aff.png)  
Then drag the value out of the loop and place it in the destroy!  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/4d46206377572823abec29d938287d4b2b2ccff9.png)  
Done! Now every sprite of kind Player does what happens in this loop! (Delete, Shoot Projectile, Use, Attack…)  
Hope this helps! And Welcome to the Forum!

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [February 6, 2021, 10:22pm UTC](https://forum.makecode.com/t/destroying-entities/6004/3 "2021-02-06T22:22:48Z")

</div>

Use the tilemaps extension. A block there does that.
