Generate map x,y

Hello, actually i have the random map generator that create a level x,y coordinates, i wanted to make it multilevel so at first i thought of x,y,level but i loose myself there so i thought of make instead of map={};

map=[];

map[level]={};

is that correct?

Not 100% sure what you are asking for here. Does each level only have one associated x,y coord?

If so, you are correct, you can do:

var map = [];
map[level] = {}
map[level].x = 4;
map[level].y = 8;

Or even:

var map = [];
map[level] = { 
    x: 4
    y: 8
};

No every level has lots of x,y,level but seems my idea was right, so i will adjust the code again…

In which case, you can have an array of array of x,y coords:

var map = [];
map[level] = [];
map[level].push({ x: 5, y: 6 });

Thanks @yaustar i will try that as i have some free time.