Interfaces is good. I am using an array that maps out how the bricks will be put down on the stage
mapArry = [
[[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]],
[[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]],
[[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]],
[[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]],
];
1 specifies brick type Number 1. but what if the next map has brick type 2 or 3
mapArry = [
[[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]],
[[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]],
[[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]],
[[2],[2],[2],[2],[2],[2],[2],[2],[2],[2]],
];
Again, I loop through the array, getting each brick. how would I use interfaces to supply the given brick ?.
The only answer I could think of is the create a brickManager class. a class that identifies each type of brick and retrieves them. But I am trying to be more efficient. I would like to know if there is a better way.
Only thing i could think of is to use dynamic initiations. I didnt know that approach went against oop.
var newVar = new ["brick"+i]();