Vlad Markushin
Vlad Markushin

Reputation: 463

How to make Tile-line?

I have 2 tiles, for example. Here is the matrix:

0,0,0,0,2
0,0,0,0,0
1,0,0,0,0

How I can automatically make a line from 1 one to point 2?

Final result will be something like that:

0,0,0,1,2
0,1,1,0,0
1,0,0,0,0

Upvotes: 1

Views: 104

Answers (1)

Ani
Ani

Reputation: 10906

Use Bresenham's line algorithm

Upvotes: 2

Related Questions