I work on a 2D shooter game with lots of moving objects on the screen (bullets etc).
I use BitmapData.copyPixels(...) to render entire screen to a buffer:BitmapData. Then I "copyPixels" from "buffer" to screen:BitmapData. The framerate is 60.
private var bitmap:Bitmap = new Bitmap();
private var buffer:Bitmap = new Bitmap();
private function start():void {
addChild(bitmap);
}
private function onEnterFrame():void {
// render into "buffer"
// copy "buffer" -> "bitmap"
}
The problem is that the sprites are tearing apart: some part of a sprite got shifted horizontally.
It looks like a PC game with VSYNC turned off.
Did anyone solve this problem?
UPDATE: the question is not about performance, but about getting rid of screen tearing.
[!] UPDATE: I've created another question and here you may try both implementations: using Flash way or BitmapData+copyPixels()