# Getting the position of Sprites from an Array and comparing Images 

**URL:** <https://forum.makecode.com/t/getting-the-position-of-sprites-from-an-array-and-comparing-images/8267>\
**Category:** Help\
**Created:** [May 22, 2021, 11:49pm UTC](https://forum.makecode.com/t/getting-the-position-of-sprites-from-an-array-and-comparing-images/8267 "2021-05-22T23:49:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WoodysWorkshop](https://avatars.discourse-cdn.com/v4/letter/w/ea666f/32.png) [@WoodysWorkshop](https://forum.makecode.com/u/WoodysWorkshop)\
**Post date:** [May 22, 2021, 11:49pm UTC](https://forum.makecode.com/t/getting-the-position-of-sprites-from-an-array-and-comparing-images/8267/1 "2021-05-22T23:49:20Z")

</div>

Hello!

Someone had shared that they’re doing a Friday Night Funkin’ game or similar and it gave me the idea for something similar…

> **[Dance Dance Start](https://arcade.makecode.com/91847-06234-77370-53994)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

The problem:

1. I know I could manually input the X-positions of the sprites at the top… and then just have a simple comparison but that’s … er… too easy?
2. I’ve made an array of sprites which are spaced equally and fixed at the top of the screen… I want to: **compare the image of the sprite that is created (the projectile) to the fixed arrows at the top… If the spawned projectile is, say, an arrow pointing left; it compares the images and gets the x-position of the arrow at the top, setting the projectile’s spawned X position as the same (so they later overlap)**

Why on Earth would you want this?!:

1. This way, it opens up possibilities to extend the game for other things at a later date… whether that’s effortlessly adding in an A or B button to press too … or to have a 2nd player etc…

I’ve included the start of my code

Thanks!  
Woody
