# Enemy Following Sprite - Help

**URL:** <https://forum.makecode.com/t/enemy-following-sprite-help/13490>\
**Category:** Help\
**Tags:** game\
**Created:** [May 9, 2022, 5:25pm UTC](https://forum.makecode.com/t/enemy-following-sprite-help/13490 "2022-05-09T17:25:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PrinceDaBezt123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/princedabezt123/32/6280_2.png) [@PrinceDaBezt123](https://forum.makecode.com/u/PrinceDaBezt123)\
**Post date:** [May 9, 2022, 5:25pm UTC](https://forum.makecode.com/t/enemy-following-sprite-help/13490/1 "2022-05-09T17:25:32Z")

</div>

Hi guys,

Does anyone know, if an enemy is following the main sprite, how to make the enemy turn right when the sprite passes them on the right side and how to make the enemy turn left when the sprite passes them on the left side? Any help is much appreciated!

Thanks ~

---

<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:** [May 11, 2022, 9:23pm UTC](https://forum.makecode.com/t/enemy-following-sprite-help/13490/2 "2022-05-11T21:23:58Z")

</div>

Here:

> [@How can I get non-player sprites to face the player?](https://forum.makecode.com/t/how-can-i-get-non-player-sprites-to-face-the-player/13113):
>
> I am currently working on a wave-based zombie survival game for a final project. I have been successful in getting the enemy sprites to follow the player and avoid obstacles to a degree. My main issue at the moment is getting the enemies to face the player at all times (or at least the enemies in view). Would anyone know of any extensions or example codes that would show how to do this??

this topic I think has the info you need!

Let me know if you have any questions!

---

<div class="post-metadata">

**Author:** ![PrinceDaBezt123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/princedabezt123/32/6280_2.png) [@PrinceDaBezt123](https://forum.makecode.com/u/PrinceDaBezt123)\
**Post date:** [May 12, 2022, 4:30pm UTC](https://forum.makecode.com/t/enemy-following-sprite-help/13490/3 "2022-05-12T16:30:13Z")

</div>

Wow. This really helped! The code worked and now my game’s back on track. Thanks so much @Kiwiphoenix364!
