I've created a 2D array and interfaced with it quite a lot through my code, but when I try to do something like this:
worldmap[x][y].eventAct = function() {
State.updateState("WorldMap");
console.log("Event called");
}
It doesn't work, however when I do this:
worldmap[x].eventAct = function() {
State.updateState("WorldMap");
console.log("Event called");
}
It works, but it becomes useless as I don't know what x and y co-ords the event takes place, I only know the x!
Any help would be appreciated!