# How to identify what type of enemy the sprite is?

**URL:** <https://forum.makecode.com/t/how-to-identify-what-type-of-enemy-the-sprite-is/28014>\
**Category:** Help\
**Tags:** game\
**Created:** [March 30, 2024, 3:32pm UTC](https://forum.makecode.com/t/how-to-identify-what-type-of-enemy-the-sprite-is/28014 "2024-03-30T15:32:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Redsword](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsword/32/12843_2.png) [@Redsword](https://forum.makecode.com/u/Redsword)\
**Post date:** [March 30, 2024, 3:32pm UTC](https://forum.makecode.com/t/how-to-identify-what-type-of-enemy-the-sprite-is/28014/1 "2024-03-30T15:32:57Z")

</div>

This is pretty complicated, so I’m making a silly dungeon crawler and I’d like to have an enemy that, when it hits a wall, redirects itself towards the player and tries again until it dies. Now, the code that I’m using works for only one enemy at a time, the other one just doesn’t move. I think that I could fix this by using an “On created sprite of kind” block, but I can’t find out a way to do this without having every enemy do the same thing, can anyone help? (Using sprite util btw if that’s important)

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

---

<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:** [March 30, 2024, 3:41pm UTC](https://forum.makecode.com/t/how-to-identify-what-type-of-enemy-the-sprite-is/28014/2 "2024-03-30T15:41:26Z")

</div>

I’m not sure if this helps, but you can define additional sprite kinds to help you keep track of different enemies.

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

If you need to keep track of a piece of data per sprite, you could use the `arcade-sprite-data` extension.

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

If you’re still stuck, then feel free to share your code and/or let us know what you’re still having trouble with.
