- #1
boo1234
- 1
- 0
Hi,
I need to come up with an equation/solution/way to return each of the co-ordinates between two points in a line.
This is for a game, I want to return the co-ords between two player locations.
Let's say for example player one is at 20,5 and player two is at 41,5
I need to return:
21,5
22,5
23,5
24,5
25,5
and so on up to 41,5
The points are dynamic
Help appreciated.
To clarify I need to return each TILE that the 'line' passes through between two players.
I need to come up with an equation/solution/way to return each of the co-ordinates between two points in a line.
This is for a game, I want to return the co-ords between two player locations.
Let's say for example player one is at 20,5 and player two is at 41,5
I need to return:
21,5
22,5
23,5
24,5
25,5
and so on up to 41,5
The points are dynamic
Help appreciated.
To clarify I need to return each TILE that the 'line' passes through between two players.