Even when I do something that has nothing to do about the script below, loading time is still long. When I set it to 48x48, it takes much less time. My PC is Duron 1.3Ghz (137fsb). I've tested on a 750Mhz CPU and it's even slower.
Code: Select all
function createBlockObject(walk,img, name)
{
this.img = new Image();
this.img.src=img;
this.walk = walk;
this.name=name;
return this;
}
var mapBlocks = new Array();
for(x=2;x!=72;x++)
{
mapBlocks[x] = Array();
for(y=1;y!=72;y++)
mapBlocks[x][y]= new createBlockObject(1,grass2,"Grasses");
}
mapBlocks[1] = Array();
for(y=1;y!=72;y++)
{
if((y%3==0) || (y%7==0))
mapBlocks[1][y]= new createBlockObject(0,tree1,0);
else
mapBlocks[1][y]= new createBlockObject(0,tree2,0);
}thanks in advanced