Hello, in a tile based game I’m making around 1300 different blocks are used for each level, as you can probably imagine this lags like crazy, so I used the following actionscript inside of each tile:
onEnterFrame = function () {
if (_root.tilecheck == 10) {
if (_root.camera.hitTest(_x, _y+100, true) || _root.camera.hitTest(_x, _y-100, true)) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
};
I made it so that it only refreshes the block every 10th of a second (60 FPS), although this method works it still generates some lag. Has anyone got advice on the best method of removing and reshowing tiles?
Thanks. Also, the tiles are .PNG files.