# How do you use an if statement for the location of a sprite?

**URL:** <https://forum.makecode.com/t/how-do-you-use-an-if-statement-for-the-location-of-a-sprite/27518>\
**Category:** Help\
**Created:** [March 5, 2024, 10:06pm UTC](https://forum.makecode.com/t/how-do-you-use-an-if-statement-for-the-location-of-a-sprite/27518 "2024-03-05T22:06:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nether\_Shard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nether_shard/32/13961_2.png) [@Nether\_Shard](https://forum.makecode.com/u/Nether_Shard)\
**Post date:** [March 5, 2024, 10:06pm UTC](https://forum.makecode.com/t/how-do-you-use-an-if-statement-for-the-location-of-a-sprite/27518/1 "2024-03-05T22:06:35Z")

</div>

In one of the games I am working on, I want to make a sign system but am too lazy to make individual sprites with individual kinds for each of them, so I want to use the location of each to distinguish them. How would I go about doing that?  
I also don’t want to put the game link since I want it to be a surprise and it is my biggest game yet, but if it will help find a fix I will put the link.  
Here is what I tried using, but it didn’t work:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/22cab91e9b4efa23f3fd3d5c2e0b3e2bbb136aa3.png)

---

<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:** [March 5, 2024, 11:43pm UTC](https://forum.makecode.com/t/how-do-you-use-an-if-statement-for-the-location-of-a-sprite/27518/3 "2024-03-05T23:43:37Z")

</div>

One way to do this would be to use the Sprite Data extension to give every sign a “text” attribute. Then when the player touches the sign you could do something like  
(Sprite) say (read (Sprite) data “text” as text)  
That is just a solution for if you want to keep the signs as sprites. Personally, what I would do is make the signs into tiles instead of sprites. Then I would make a List with all the text I want, with each variable spot in the list being the text for a different sign. Which I have made an example of right [here!!!](https://arcade.makecode.com/S87539-65635-33619-79876)  
I made that in around 5 minutes and it works really well! Feel free to copy it of course!
