Hi Every1.
The tile based game that i am doing is currently loading 25 x 25 pixel pngs to create the map. The problem i am having with this is that it is taking too long, i.e. circa 30 secs at least. I am loading the tiles via this way:
private function loadBitmaps():void
{
if (_currentId >= _mapArray.length) {
drawMap();
return;
}
if (_loader.content != null) _loader.unload();
_loader.load(new URLRequest(_mapArray[_currentId].img));
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeTile);
}
private function completeTile(e:Event) {
_mapArray[_currentId].bmp = (_loader.content as Bitmap);
_currentId++;
loadBitmaps();
}
the initial loadBitmap is called once the user chooses the map.
My question is, how can I improve the load speed? Im sure there is a more efficient way to load tiles that correspond to an array.
Thanks for your help.