Best way of optimization animation

You have two things:

1.) When it is time to update your object, change to the next graphic

This is done automatically when you use MovieClip (which is wired for using SWF assets from Adobe Animate or Flash Professional this way)

Otherwise, a combination of Event.ENTER_FRAME plus openfl.Lib.getTimer is a good way to update. On each frame, check the milliseconds elapsed since the previous frame, and use that to determine whether it is time to animate to the next frame.

2.) Render the changes once you are done

There is a spritesheet library, and another library shared recently that should do animation for you.

Tilemap has been documented elsewhere here on the forums, or the BunnyMark demo uses Tilemap.

1 Like