# How do i find out is two sprites are on the same tile-map column or row?

**URL:** https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222
**Category:** Help
**Created:** [January 3, 2023, 5:54pm UTC](https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222 "2023-01-03T17:54:37Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)
#### Post date: [January 3, 2023, 5:54pm UTC](https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222/1 "2023-01-03T17:54:37Z")

</div>

I need to tell an enemy that it’s lined up with the player on the tile map. How do I do that.

---

<div class="post-metadata">

### Author: ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)
#### Post date: [January 3, 2023, 6:18pm UTC](https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222/2 "2023-01-03T18:18:36Z")

</div>

You could check if the player’s x and y poisiton is the same as the enemies.

---

<div class="post-metadata">

### Author: ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)
#### Post date: [January 3, 2023, 7:15pm UTC](https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222/3 "2023-01-03T19:15:57Z")

</div>

but i need the col and row  
not x and y

---

<div class="post-metadata">

### Author: ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)
#### Post date: [January 3, 2023, 7:36pm UTC](https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222/4 "2023-01-03T19:36:19Z")

</div>

Hmm, I could have a solution. Do you have the camera moving around or staying still?

---

<div class="post-metadata">

### Author: ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)
#### Post date: [January 4, 2023, 5:30pm UTC](https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222/5 "2023-01-04T17:30:12Z")

</div>

Moving

---

<div class="post-metadata">

### Author: ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)
#### Post date: [January 4, 2023, 5:57pm UTC](https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222/7 "2023-01-04T17:57:03Z")

</div>

Woah thanks my solution was a lot harder than that one- I’ve never understood those blocks before!

---

<div class="post-metadata">

### Author: ![Codeboy-Advanced](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeboy-advanced/32/11113_2.png) [@Codeboy-Advanced](https://forum.makecode.com/u/Codeboy-Advanced)
#### Post date: [January 6, 2023, 6:05pm UTC](https://forum.makecode.com/t/how-do-i-find-out-is-two-sprites-are-on-the-same-tile-map-column-or-row/17222/8 "2023-01-06T18:05:16Z")

</div>

Oh, that makes sense. I was trying to use those blocks but they never worked.
