Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualwqking

Posted 23 September 2012 - 05:37 AM

EDIT: Sorry, just realized my below algorithm is incorrect, ignore it for now.

Loop start from one point, move in dx=TileWidth-1, dy=TileHeight-1 toward to the end point, until reach or beyond the end point.
In each move, get the tile at that point, check if it's a solid tile.
This will be sure you loop all tiles covered by the line and won't miss any tile.

#1wqking

Posted 23 September 2012 - 05:33 AM

Not approved, hope the simple algorithm works.

Loop start from one point, move in dx=TileWidth-1, dy=TileHeight-1 toward to the end point, until reach or beyond the end point.
In each move, get the tile at that point, check if it's a solid tile.
This will be sure you loop all tiles covered by the line and won't miss any tile.

PARTNERS