I’m trying to make a map creation system similiar to a risk strategy game, I want to store the data for each map in a group of nested arrays but I’m really bad with arrays and can’t get them to work, here is what I would like to do (but doesn’t work):
map['maxPlayers'] = 2;
map['platforms'] = Array;
//Platform 1
map['platforms'][0] = Array;
map['platforms'][0]['ID'] = 1;
map['platforms'][0]['ownerID'] = 1;
map['platforms'][0]['type'] = 1;
map['platforms'][0]['troopCount'] = 1;
map['platforms'][0]['atkBonus'] = 1;
map['platforms'][0]['defBonus'] = 1;
map['platforms'][0]['proBonus'] = 1;
map['platforms'][0]['nodes'] = 1;
//Platform 2
map['platforms'][1] = Array;
map['platforms'][1]['ID'] = 1;
map['platforms'][1]['ownerID'] = 1;
map['platforms'][1]['type'] = 1;
map['platforms'][1]['troopCount'] = 1;
map['platforms'][1]['atkBonus'] = 1;
map['platforms'][1]['defBonus'] = 1;
map['platforms'][1]['proBonus'] = 1;
map['platforms'][1]['nodes'] = 1;
This is what would be ideal for me but I can’t get it to work, I’s sure it’s just some simple sintax problem I’m having but any help would be great thanks!