# How do I get enmities to spawn

**URL:** <https://forum.makecode.com/t/how-do-i-get-enmities-to-spawn/36923>\
**Category:** Arcade\
**Created:** [May 25, 2025, 5:30pm UTC](https://forum.makecode.com/t/how-do-i-get-enmities-to-spawn/36923 "2025-05-25T17:30:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReVive\_sk8](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/revive_sk8/32/22221_2.png) [@ReVive\_sk8](https://forum.makecode.com/u/ReVive_sk8)\
**Post date:** [May 25, 2025, 5:30pm UTC](https://forum.makecode.com/t/how-do-i-get-enmities-to-spawn/36923/1 "2025-05-25T17:30:48Z")

</div>

So I want to make a platformer game and have enimies with the same code in different places specifically so how do I do that here’s a link  
([https://arcade.makecode.com/S58825-62355-71999-57509](https://arcade.makecode.com/S58825-62355-71999-57509))

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [May 26, 2025, 3:31am UTC](https://forum.makecode.com/t/how-do-i-get-enmities-to-spawn/36923/2 "2025-05-26T03:31:45Z")

</div>

Right now your main issue is that these two variables aren’t the same:

 ![IMG_8892](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/2/5286095dff03c253e069c0f3f4e0699b57754bd1.jpeg)  
Then to run code for a bunch of enemies, you can change the SpriteKind of the ghost thing to “enemy” and do something like “For (value) of (array of all sprites of kind [enemy])…” and that “value” variable holds the sprite you are running code on.

---

<div class="post-metadata">

**Author:** ![ReVive\_sk8](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/revive_sk8/32/22221_2.png) [@ReVive\_sk8](https://forum.makecode.com/u/ReVive_sk8)\
**Post date:** [May 27, 2025, 2:08am UTC](https://forum.makecode.com/t/how-do-i-get-enmities-to-spawn/36923/3 "2025-05-27T02:08:49Z")

</div>

I’ll try it
