I am making simple grid like game ( grid is matrix 128×128) and matrix is filled with 0 and 1 ( 1 bullet can pass through, 0 bullet cannot pass through cannot continue to travel anymore, also I have bullet range 32 cells).
I am standing for example at position (32,89). Can anyone suggest me any efficient algorithm for calculating all shootable fields ? ( I know to calculate on simple way with simple checking every filed in range, but I wonder is there better idea)
I am making simple grid like game ( grid is matrix 128×128) and matrix
Share
There is a more efficient algorithm. Eric Lippert has written an excellent series on shadow casting in grid games. If I understand correctly, this is exactly what you need.