   Handling animations that move the object
  I'm working on a 2D platforming game, and at the moment I'm trying to incorporate a "climb up onto ledge" animation that looks like this:Up to now, all of my animations have been just things for the player to be doing while they move in some simple -- running, crawling, turning around, jumping, falling, hanging from a ledge, etc. They either loop continuously or play to a certain target frame and then stop, while the player moves based on input and physics. Moreover, they all have simple collision detection handled by single convex bounding polygons that don't change over the course of the animation.This animation, though, requires moving the player in a specific fashion as the animation plays out, and cannot be simulated by a single bounding polygon without running into issues. So I'm looking for recommendations on how to handle this. At the moment, my animations are mapped to bounding polygons using a simple format like this:run-l:55,10:95,10:95,145:55,145skid-l:55,10:95,10:95,145:55,145crouch-l:55,65:95,65:95,145:55,145crawl-l:35,95:115,95:115,140:35,140And so forth. All of these polygons work with the same logical location for the player at (0, 0), and smoothly transition from one to the other without needing to change drawing offsets or anything like that.At the most complex and detailed, I could extend this to include multiple bounding polygons depending on the frame (and more than just one polygon on a given frame, too), and include required movement of the object's logical location over the course of the animation. But that gets pretty hugely complex; I'd rather not take things that far if I don't have to.At its simplest, I could simply add a positional offset onto the animation saying "Once you're done, move to here", and use a minimal bounding polygon for the animation -- basically, the player would be invincible while executing the animation. This would require me to check terrain legality for the animation manually, which decreases flexibility, but it'd be far simpler to implement. Any suggestions for things I'm missing here? General advice? I don't want to have to rewrite this a dozen times as I add more features to the game (nor do I want to have to write dozens of clunky datafiles to use a poorly-made system), so I'd rather get this right, now, before a transition costs me too much.   
  I'm not sure whether your problem is just handling the bounding box or if there's more to it. Your mention of 'terrain legality' hints at there being more but I don't understand what you're referring to.In terms of pure collision detection I'd be inclined to say that linear interpolation would be good enough in most cases. Instead of one bounding polygon, have two (with the same number of vertices), one for the start of the animation and one for the end. With most animations these could be identical, but with the ones that move you or significantly change your shape or orientation, they would differ. At any point along the animation you can calculate the currently valid bounding polygon by linearly interpolating from the vertices in the first frame to the vertices in the last frame. I don't think this is very complex really; just twice the data and an interpolation calculation for each vertex, with no special cases needed for your existing anims. It would also extend well to a key-frame based system later if you decide you need more precision.   