Sha256: 94efcfa790446df803ccd36f16c69bc14b78af24cc7a0f9722a2fc2d6ed3bc4b

Contents?: true

Size: 721 Bytes

Versions: 2

Compression:

Stored size: 721 Bytes

Contents

module Joybox
  module Actions
    module D3

      class Jump

        def self.defaults
          {
            duration: 0.3,
            jumps: 1,
            amplitude: 10
          }
        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)
          CCJumpTiles3D.actionWithJumps(options[:jumps],
                                        amplitude: options[:amplitude],
                                        grid: options[:grid_size],
                                        duration: options[:duration])
        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/jump.rb
joybox-1.1.0 motion/joybox/actions/d3/jump.rb