def play(opts = {}, &done_proc)

      animation = opts[:animation]
      loop = opts[:loop]
      flip = opts[:flip]

      if !@playing || (animation != @playing_animation && animation != nil) || flip != @flip

        @playing = true
        @playing_animation = animation || :default
        frames = @animations[@playing_animation]
        flip_sprite(flip)
        @done_proc = done_proc

        case frames
        # When animation is a range, play through frames horizontally
        when Range
          @first_frame   = frames.first || @defaults[:frame]
          @current_frame = frames.first || @defaults[:frame]
          @last_frame    = frames.last
        # When array...
        when Array
          @first_frame   = 0
          @current_frame = 0
          @last_frame    = frames.length - 1
        end

        # Set looping
        @loop = loop == true || @defaults[:loop] ? true : false

        set_frame
        restart_time
      end
    end
def play(opts = {}, &done_proc)

      animation = opts[:animation]
      loop = opts[:loop]
      flip = opts[:flip]

      if !@playing || (animation != @playing_animation && animation != nil) || flip != @flip

        @playing = true
        @playing_animation = animation || :default
        frames = @animations[@playing_animation]
        flip_sprite(flip)
        @done_proc = done_proc

        case frames
        # When animation is a range, play through frames horizontally
        when Range
          @first_frame   = frames.first || @defaults[:frame]
          @current_frame = frames.first || @defaults[:frame]
          @last_frame    = frames.last
        # When array...
        when Array
          @first_frame   = 0
          @current_frame = 0
          @last_frame    = frames.length - 1
        end

        # Set looping
        @loop = loop == true || @defaults[:loop] ? true : false

        set_frame
        restart_time
      end
    end
Play an animation