How to have an animation check collision every frame or transform animation into flipbook and back?

2D animation?