Sha256: 33f01b387e81db4166adbd0d77b4cb27b6e0588e339fc676cd03765993482fd7

Contents?: true

Size: 939 Bytes

Versions: 2

Compression:

Stored size: 939 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.0.0 motion/joybox/actions/jump.rb
joybox-0.0.6 motion/joybox/actions/jump.rb