# Coins Not Destroying

**URL:** <https://forum.makecode.com/t/coins-not-destroying/8854>\
**Category:** Help\
**Created:** [June 21, 2021, 3:08pm UTC](https://forum.makecode.com/t/coins-not-destroying/8854 "2021-06-21T15:08:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThunderDrop180](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thunderdrop180/32/6820_2.png) [@ThunderDrop180](https://forum.makecode.com/u/ThunderDrop180)\
**Post date:** [June 21, 2021, 3:08pm UTC](https://forum.makecode.com/t/coins-not-destroying/8854/1 "2021-06-21T15:08:55Z")

</div>

So, in [my game](https://makecode.com/_WmzT5JYh5Jku) whenever you beat the 1st level without collecting any coins, then the 2nd level has the same coins from the 1st level still appear. does anyone know how to fix this?

> **Link**
>
> [https://makecode.com/\_WmzT5JYh5Jku](https://makecode.com/_WmzT5JYh5Jku)  
> even though i had a hyperlink up there

Think of this as the demo of my next big game!

---

<div class="post-metadata">

**Author:** ![biscuit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/biscuit/32/4404_2.png) [@biscuit](https://forum.makecode.com/u/biscuit)\
**Post date:** [June 21, 2021, 3:45pm UTC](https://forum.makecode.com/t/coins-not-destroying/8854/2 "2021-06-21T15:45:16Z")

</div>

What the problem seems to be to me is your next level function.  
 ![Screenshot 2021-06-21 9.34.51 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/70d78386d24694c6556291f6eb704cf36f185863.png)  
It only destroys one coin, most likely the most recently created one because with your create coin code it names them all Coin. One fix to this would to be to destroy all of the coins (which would be harder), or to only be able to progress to the next level if you have collected all the coins (much easier fix, but might not be what you want for your game).

---

<div class="post-metadata">

**Author:** ![ThunderDrop180](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thunderdrop180/32/6820_2.png) [@ThunderDrop180](https://forum.makecode.com/u/ThunderDrop180)\
**Post date:** [June 21, 2021, 5:37pm UTC](https://forum.makecode.com/t/coins-not-destroying/8854/3 "2021-06-21T17:37:39Z")

</div>

Thank you! I’ll probably go with Option 2 as its not tedious to do.

---

<div class="post-metadata">

**Author:** ![biscuit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/biscuit/32/4404_2.png) [@biscuit](https://forum.makecode.com/u/biscuit)\
**Post date:** [June 21, 2021, 7:21pm UTC](https://forum.makecode.com/t/coins-not-destroying/8854/4 "2021-06-21T19:21:34Z")

</div>

Yeah, I tried doing something like that awhile ago and it ended up just not working after trying for 3 hours. Hope that your game goes well though!

---

<div class="post-metadata">

**Author:** ![livcheerful](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/livcheerful/32/3509_2.png) [@livcheerful](https://forum.makecode.com/u/livcheerful)\
**Post date:** [June 22, 2021, 12:18am UTC](https://forum.makecode.com/t/coins-not-destroying/8854/5 "2021-06-22T00:18:00Z")

</div>

it’s not that bad to destroy all the coins if you still want to do that! you can loop over all the sprites of kind coin and destroy them:

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

> **[Penguin Run](https://arcade.makecode.com/67761-70781-90947-25717)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![ThunderDrop180](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thunderdrop180/32/6820_2.png) [@ThunderDrop180](https://forum.makecode.com/u/ThunderDrop180)\
**Post date:** [June 22, 2021, 5:01pm UTC](https://forum.makecode.com/t/coins-not-destroying/8854/6 "2021-06-22T17:01:48Z")

</div>

Thank you! i never knew you could use “For element value of list” block so well!

---

<div class="post-metadata">

**Author:** ![biscuit](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/biscuit/32/4404_2.png) [@biscuit](https://forum.makecode.com/u/biscuit)\
**Post date:** [June 22, 2021, 5:06pm UTC](https://forum.makecode.com/t/coins-not-destroying/8854/7 "2021-06-22T17:06:29Z")

</div>

I didn’t know that, that’s really cool!

---

<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:** [June 23, 2021, 3:37pm UTC](https://forum.makecode.com/t/coins-not-destroying/8854/8 "2021-06-23T15:37:43Z")

</div>

Or you could use the destroy all of kind () block from the tilemaps extension.
