Page 1 of 1

Creating levels for my game easier.

Posted: Fri May 11, 2018 2:57 pm
by Ducktor Cid
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?

Re: Creating levels for my game easier.

Posted: Fri May 11, 2018 3:04 pm
by Nelvin
You could give https://www.mapeditor.org/ a try

Re: Creating levels for my game easier.

Posted: Fri May 11, 2018 3:24 pm
by bobbyjones
Yeah tiled should work great for that. You can use it in conjunction with STI to load the levels.