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?
Creating levels for my game easier.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Ducktor Cid
- Prole
- Posts: 18
- Joined: Wed Oct 05, 2016 8:08 pm
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Creating levels for my game easier.
Yeah tiled should work great for that. You can use it in conjunction with STI to load the levels.
Who is online
Users browsing this forum: Google [Bot] and 3 guests