# Help with counting the number of enemies killed

**URL:** <https://forum.makecode.com/t/help-with-counting-the-number-of-enemies-killed/9492>\
**Category:** Help\
**Created:** [August 2, 2021, 3:35pm UTC](https://forum.makecode.com/t/help-with-counting-the-number-of-enemies-killed/9492 "2021-08-02T15:35:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![help](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/help/32/4852_2.png) [@help](https://forum.makecode.com/u/help)\
**Post date:** [August 2, 2021, 3:35pm UTC](https://forum.makecode.com/t/help-with-counting-the-number-of-enemies-killed/9492/1 "2021-08-02T15:35:59Z")

</div>

I’m creating a simple platformer for school and I was wondering if there was a way to reach the next level if all enemies are dead.

---

<div class="post-metadata">

**Author:** ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)\
**Post date:** [August 2, 2021, 11:28pm UTC](https://forum.makecode.com/t/help-with-counting-the-number-of-enemies-killed/9492/2 "2021-08-02T23:28:44Z")

</div>

You can use this code:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/03eea6c7b1c16c248fd2bba899dd5e11710ba04b.png)  
and the change level by 1 only happens if all enemies are killed. Also welcome to the Makecode community!

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [August 3, 2021, 10:20pm UTC](https://forum.makecode.com/t/help-with-counting-the-number-of-enemies-killed/9492/3 "2021-08-03T22:20:39Z")

</div>

This would be a bit more efficient:

 ![arcade-screenshot (1)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/a588b05dae7b25b6842e775ec110f01e6b43cd31.png)

Same result, though! Good work!

---

<div class="post-metadata">

**Author:** ![help](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/help/32/4852_2.png) [@help](https://forum.makecode.com/u/help)\
**Post date:** [August 4, 2021, 6:02am UTC](https://forum.makecode.com/t/help-with-counting-the-number-of-enemies-killed/9492/4 "2021-08-04T06:02:39Z")

</div>

Thanks 🙂
