- var dx = animation.frames[1].texture_coords[0] - animation.frames[0].texture_coords[0]
- var dy = animation.frames[1].texture_coords[1] - animation.frames[0].texture_coords[1]
+ var dx = 0.0
+ var dy = 0.0
+ if animation.frames.length > 1 then
+ dx = animation.frames[1].texture_coords[0] - animation.frames[0].texture_coords[0]
+ dy = animation.frames[1].texture_coords[1] - animation.frames[0].texture_coords[1]
+ end