# How to count the amount of a certain sprite there are?

**URL:** <https://forum.makecode.com/t/how-to-count-the-amount-of-a-certain-sprite-there-are/41682>\
**Category:** Help\
**Created:** [January 23, 2026, 3:40am UTC](https://forum.makecode.com/t/how-to-count-the-amount-of-a-certain-sprite-there-are/41682 "2026-01-23T03:40:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![YamJam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yamjam/32/29681_2.png) [@YamJam](https://forum.makecode.com/u/YamJam)\
**Post date:** [January 23, 2026, 3:40am UTC](https://forum.makecode.com/t/how-to-count-the-amount-of-a-certain-sprite-there-are/41682/1 "2026-01-23T03:40:24Z")

</div>

I was wondering if it was possible to count the amount of a certain sprite there are that are currently existing. This would be very useful for me since I’m making a game that has waves and I don’t want to have the player wait for the next round of enemies to come if they kill them to fast.

---

<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:** [January 23, 2026, 3:57am UTC](https://forum.makecode.com/t/how-to-count-the-amount-of-a-certain-sprite-there-are/41682/2 "2026-01-23T03:57:36Z")

</div>

Do you mean you want to know how many sprites of a particular _kind_ exist? Like … how many `Enemy` sprites exist?

If so, you can do this:

 ![arcade-screenshot (17)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/8/e8051dca68196d33127b26b22c683cc20f40a60c.png)

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [January 23, 2026, 3:57am UTC](https://forum.makecode.com/t/how-to-count-the-amount-of-a-certain-sprite-there-are/41682/3 "2026-01-23T03:57:57Z")

</div>

If all sprites that are enemies share the same SpriteKind, use

```auto
sprites.allOfKind(SpriteKind.[InsertSpriteKind]).length

```

to get how many there are currently present.  
_Note: This was scripted through MakeCode’s JavaScript._

---

<div class="post-metadata">

**Author:** ![YamJam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yamjam/32/29681_2.png) [@YamJam](https://forum.makecode.com/u/YamJam)\
**Post date:** [January 23, 2026, 4:20am UTC](https://forum.makecode.com/t/how-to-count-the-amount-of-a-certain-sprite-there-are/41682/4 "2026-01-23T04:20:57Z")

</div>

wait do I have to like put the sprites in the list? Because my coding instincts are telling me yes

---

<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:** [January 23, 2026, 4:23am UTC](https://forum.makecode.com/t/how-to-count-the-amount-of-a-certain-sprite-there-are/41682/5 "2026-01-23T04:23:25Z")

</div>

You don’t have to do that manually, no, as long as you’re counting sprites of a particular kind. The blue block in my code creates the list for you.
