Get actor by location?

I have this function generating tiles. Is there any quick way to get actor by entering its location. Later I will assign variable to location which will be obtained by some math.

I know how to to access location from array by element. But its still actor to location.

I want location to actor.

I want to assign some values to my tiles and these values will be position dependent rather than my sprite index.

So do we have such option?

Or Do I have to create a function for that ? If yes then

what is best way to do it (less looping kind) as you can see my sprites are in array ?

I want location to actor.

Looking at this makes me wonder how annoying it would be to use. At least it’s blazing fast!

Are you expecting to enter the exact actor location, or a rough location?

Yes Maybe. I will round the values somehow obtained from math so the location will be exact.

Thanks I never knew we could define such variables. I will try it

I want location to actor

Circling back to the other thread where I was so insistent on knowing the ID method, it now turns out it was simply a location. I wouldn’t use a regular vector for this as float components will ruin it; but this could potentially work:

Never used it like this, worth testing out, though.

Good luck!


Still believe it’d be much easier (and reliable!) with an ID, tag, enumeration… any other method, really.

I haven’t used enumeration before. I will try all methods though as I still don’t have clear idea about what I am achieving here. Its more of a exploring

Thanks for this answer.