Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17093

How to get Tile GID value that is the closest distance compared with one specific coordinate?

$
0
0

@rhythmcoder wrote:

Hi.
I am a newbie in cocos2d-x.

I know the way of set tile GID value.
And I also know the coordinate of Player and GID value of the coordinate.

My question is, How to find closest distance compared with one specific coordinate.

For example, '1' is the player's coordinate, '2' is the feed of player's coordinate.

0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 2 0
0 0 0 0 0 0 0 0 0 0
0 2 0 0 0 2 0 0 0 0
0 0 0 2 0 0 0 0 0 0
0 0 0 0 0 0 0 2 0 0
0 0 0 0 0 0 0 0 0 0

How to find closest 2 coordinate compared with 1?
Is there any specific function in cocos2d-x to apply this?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17093


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>