I want to make 1 tile.I'm having problems with array.
In adobe
ActionScript Code:
public var myMap:Array=new Array();
public function Map():void {
myMap = [
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 1, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1]
];
}
to add:
ActionScript Code:
for (var i = 0; i < Number(lvl.length); i++) {
for (var j = 0; j < Number(lvl[i].length); j++) {
if (lvl[i][j] == 1) {
var hs:House=new House();
hs.x=j*100+50;
hs.y=i*100+50;
addChild(hs);
}
}
}
How to declare this array in haXe?
thanks