Sha256: 057390f94a92bd27fb0529116cffb483d2ed3fbc4f1b8c12114b999af537c035

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

module Joybox
  module Actions
    module D3

      class Shatter

        def self.defaults
          {
            duration: 0.3,
            range: 10,
            shatter_z: true
          }
        end

        def self.with(options = {})
          # Todo print error message on the console
          return unless options.has_key? :grid_size

          options = options.nil? ? defaults : defaults.merge!(options)
          CCShatteredTiles3D.actionWithDuration(options[:duration],
                                                size: options[:grid_size],
                                                range: options[:range],
                                                shatterZ: options[:shatter_z])
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 motion/joybox/actions/d3/shatter.rb
joybox-1.1.0 motion/joybox/actions/d3/shatter.rb