# On player overlaps array of enemy run animation

**URL:** <https://forum.makecode.com/t/on-player-overlaps-array-of-enemy-run-animation/6635>\
**Category:** Help\
**Created:** [March 8, 2021, 5:43pm UTC](https://forum.makecode.com/t/on-player-overlaps-array-of-enemy-run-animation/6635 "2021-03-08T17:43:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jloosem](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@jloosem](https://forum.makecode.com/u/jloosem)\
**Post date:** [March 8, 2021, 5:43pm UTC](https://forum.makecode.com/t/on-player-overlaps-array-of-enemy-run-animation/6635/1 "2021-03-08T17:43:08Z")

</div>

I am trying to make it so when the ghost overlaps guy(player) then it will do an attacking animation which will cause the player to lose a life/health. my enemies are set up in a array because I needed a way for them to move independently when the player is in a certain radius. (to get to the ghosts go through the door on the top left corner). thank you let me know what you think.

> **[Dungeon Master](https://arcade.makecode.com/10157-54997-60072-87985)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<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:** [March 8, 2021, 8:39pm UTC](https://forum.makecode.com/t/on-player-overlaps-array-of-enemy-run-animation/6635/2 "2021-03-08T20:39:01Z")

</div>

There were lots of issues. You need to also depend on arrays whenever you have multiple enemies or sprites of the same purpose and kind.

---

<div class="post-metadata">

**Author:** ![jloosem](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@jloosem](https://forum.makecode.com/u/jloosem)\
**Post date:** [March 9, 2021, 4:22pm UTC](https://forum.makecode.com/t/on-player-overlaps-array-of-enemy-run-animation/6635/3 "2021-03-09T16:22:20Z")

</div>

what are the issues, I can’t get it to work

---

<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:** [March 9, 2021, 7:44pm UTC](https://forum.makecode.com/t/on-player-overlaps-array-of-enemy-run-animation/6635/4 "2021-03-09T19:44:24Z")

</div>

Forgot to include the link…

---

<div class="post-metadata">

**Author:** ![jloosem](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@jloosem](https://forum.makecode.com/u/jloosem)\
**Post date:** [March 10, 2021, 4:04pm UTC](https://forum.makecode.com/t/on-player-overlaps-array-of-enemy-run-animation/6635/5 "2021-03-10T16:04:47Z")

</div>

what link?
