OK, so AppGameKit doesn't recalculate collision shapes on sprites when you change their frames. In one way this is good, because it saves a massive amount of overhead when there is very little that changes between frames.
In your case it's bad because there is obviously a very large difference between the animation frames.
The only thing I can think to do is that as you change from a rounded box sprite to a triangle sprite, you issue the following:
// code to change sprite from box to triangle...
SetSpriteShape(l_sprite_id,0)
SetSpriteShape(l_sprite_id,3)
That should remove the existing collision box and setup a new one bsaed on the new image shape.