Creating levels for my game easier.
Posted: Fri May 11, 2018 2:57 pm
My game's levels are a hexagonal grid. Currently, I use a 2D array to set data for the grid (each hexagon has: type (water, fire, earth or wall) and a value for who's controlling it (player or AI))
This is the 2D array for my first level:
Level.gridData={
{0,0,0,12,12,12,12},
{0,0,12,12,12,12,12},
{0,12,12,13,13,12,12},
{24,24,24,24,24,24,24},
{23,23,23,23,23,23,0},
{23,23,23,23,23,0,0},
{23,23,23,23,0,0,0}
}
One of the things I want to do with future levels is expand the size/diameter of the grid. Which will, obviously, enlarge the 2D array and make it hard to type in directly to the table.
Does anyone have a good solution?
This is the 2D array for my first level:
Level.gridData={
{0,0,0,12,12,12,12},
{0,0,12,12,12,12,12},
{0,12,12,13,13,12,12},
{24,24,24,24,24,24,24},
{23,23,23,23,23,23,0},
{23,23,23,23,23,0,0},
{23,23,23,23,0,0,0}
}
One of the things I want to do with future levels is expand the size/diameter of the grid. Which will, obviously, enlarge the 2D array and make it hard to type in directly to the table.
Does anyone have a good solution?