# How to make something happen if a sprite is behind another sprite

**URL:** <https://forum.makecode.com/t/how-to-make-something-happen-if-a-sprite-is-behind-another-sprite/39972>\
**Category:** Help\
**Created:** [October 25, 2025, 6:09pm UTC](https://forum.makecode.com/t/how-to-make-something-happen-if-a-sprite-is-behind-another-sprite/39972 "2025-10-25T18:09:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dlee](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@Dlee](https://forum.makecode.com/u/Dlee)\
**Post date:** [October 25, 2025, 6:09pm UTC](https://forum.makecode.com/t/how-to-make-something-happen-if-a-sprite-is-behind-another-sprite/39972/1 "2025-10-25T18:09:26Z")

</div>

In my game, I want the boss to turn around when my sprite is behind it [https://arcade.makecode.com/S31913-79314-08849-08052](https://arcade.makecode.com/S31913-79314-08849-08052). This would be really helpful for game.

---

<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:** [October 26, 2025, 1:44am UTC](https://forum.makecode.com/t/how-to-make-something-happen-if-a-sprite-is-behind-another-sprite/39972/2 "2025-10-26T01:44:53Z")

</div>

Something like  
“If (player X [\>] Boss X): set boss image to (boss facing right)  
Else: set boss image to (boss facing left)”

That should work.

---

<div class="post-metadata">

**Author:** ![Dlee](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@Dlee](https://forum.makecode.com/u/Dlee)\
**Post date:** [October 27, 2025, 4:28am UTC](https://forum.makecode.com/t/how-to-make-something-happen-if-a-sprite-is-behind-another-sprite/39972/3 "2025-10-27T04:28:52Z")

</div>

Can you show me what that would look like?

---

<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:** [October 27, 2025, 5:27pm UTC](https://forum.makecode.com/t/how-to-make-something-happen-if-a-sprite-is-behind-another-sprite/39972/4 "2025-10-27T17:27:53Z")

</div>

![IMG_0652](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/e/2eebcca7b22a02f0901b43844e08e368119632cf.jpeg)

> **[test](https://arcade.makecode.com/S13738-86126-05316-47576)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![MeatballDev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/meatballdev/32/28502_2.png) [@MeatballDev](https://forum.makecode.com/u/MeatballDev)\
**Post date:** [October 27, 2025, 5:56pm UTC](https://forum.makecode.com/t/how-to-make-something-happen-if-a-sprite-is-behind-another-sprite/39972/5 "2025-10-27T17:56:38Z")

</div>

there is an `On Overlap` Block for this

---

<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:** [October 28, 2025, 2:25am UTC](https://forum.makecode.com/t/how-to-make-something-happen-if-a-sprite-is-behind-another-sprite/39972/6 "2025-10-28T02:25:24Z")

</div>

Unfortunately, no there is not.
