I am working on a top down 2D grid based game, where as it is currently, units have a movement and an attack range. An example of this:
The blue squares are tiles the selected unit can move to, the red are tiles they can attack. Defining this is pretty easy, for the weapon/attack I just give it a minimum and a maximum range, and use that to figure out where they can attack. What I would like to do is create attacks that can attack multiple tiles. Something like a straight line would probably be pretty easy, but more complex patterns. Something like the following:
x-x
-x-
x-x
Or
--x--
-xxx-
xxxxx
Where the "x"s are the attackable tiles and the "-"s are not. An example illustration:
I am not sure how I should go about defining this data. I currently save the weapon/attack data in a CSV file, but am open to moving it to JSON as it gets more complicated. But right now I am just drawing a complete blank as to how I should approach this problem. Anyone have any ideas?
Thanks.


