canvas: generic way to track movement of a sprite