Sha256: 4c15fbca5f3b6c3fc0b50bb05f09ec92610c855fd18c55e087d4af581283f34f

Contents?: true

Size: 190 Bytes

Versions: 48

Compression:

Stored size: 190 Bytes

Contents

#
#
module VectorUtilities
  
  # Return a random vector with a given strength.
  #
  def random_vector strength = 1.0
    CP::Vec2.new(rand-0.5, rand-0.5).normalize! * strength
  end
  
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
gosu_extensions-0.3.8 lib/core/vector_utilities.rb
gosu_extensions-0.3.7 lib/core/vector_utilities.rb
gosu_extensions-0.3.6 lib/core/vector_utilities.rb
gosu_extensions-0.3.5 lib/core/vector_utilities.rb
gosu_extensions-0.3.4 lib/core/vector_utilities.rb
gosu_extensions-0.3.3 lib/core/vector_utilities.rb
gosu_extensions-0.3.2 lib/core/vector_utilities.rb
gosu_extensions-0.3.1 lib/core/vector_utilities.rb
gosu_extensions-0.3.0 lib/core/vector_utilities.rb
gosu_extensions-0.2.9 lib/core/vector_utilities.rb
gosu_extensions-0.2.8 lib/core/vector_utilities.rb
gosu_extensions-0.2.7 lib/core/vector_utilities.rb
gosu_extensions-0.2.6 lib/core/vector_utilities.rb
gosu_extensions-0.2.5 lib/core/vector_utilities.rb
gosu_extensions-0.2.4 lib/core/vector_utilities.rb
gosu_extensions-0.2.3 lib/core/vector_utilities.rb
gosu_extensions-0.2.2 lib/core/vector_utilities.rb
gosu_extensions-0.2.1 lib/core/vector_utilities.rb
gosu_extensions-0.2.0 lib/core/vector_utilities.rb
gosu_extensions-0.1.28 lib/core/vector_utilities.rb