Sha256: 9298a65d18a02e9f7995e8808903a7e0324f19ce150ca7b3fa490ad9ca74c5e8

Contents?: true

Size: 934 Bytes

Versions: 2

Compression:

Stored size: 934 Bytes

Contents

module Joybox
  module Actions

    class Jump

      def self.defaults
        {
          duration: 0.3,
          position: [0, 0],
          height: 0.0,
          jumps: 1
        }
      end

      def self.by(options = {})
        options = options.nil? ? defaults : defaults.merge!(options)
        CCJumpBy.actionWithDuration(options[:duration], 
                                    position: options[:position], 
                                    height: options[:height], 
                                    jumps: options[:jumps])
      end

      def self.to(options = {})
        options = options.nil? ? defaults : defaults.merge!(options)
        CCJumpTo.actionWithDuration(options[:duration], 
                                    position: options[:position], 
                                    height: options[:height], 
                                    jumps: options[:jumps])
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 motion/joybox/actions/jump.rb
joybox-1.1.0 motion/joybox/actions/jump.rb