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.1.27 lib/core/vector_utilities.rb
gosu_extensions-0.1.26 lib/core/vector_utilities.rb
gosu_extensions-0.1.25 lib/core/vector_utilities.rb
gosu_extensions-0.1.24 lib/core/vector_utilities.rb
gosu_extensions-0.1.23 lib/core/vector_utilities.rb
gosu_extensions-0.1.22 lib/core/vector_utilities.rb
gosu_extensions-0.1.21 lib/core/vector_utilities.rb
gosu_extensions-0.1.20 lib/core/vector_utilities.rb
gosu_extensions-0.1.19 lib/core/vector_utilities.rb
gosu_extensions-0.1.18 lib/core/vector_utilities.rb
gosu_extensions-0.1.17 lib/core/vector_utilities.rb
gosu_extensions-0.1.16 lib/core/vector_utilities.rb
gosu_extensions-0.1.15 lib/core/vector_utilities.rb
gosu_extensions-0.1.14 lib/vector_utilities.rb
gosu_extensions-0.1.13 lib/vector_utilities.rb
gosu_extensions-0.1.12 lib/vector_utilities.rb
gosu_extensions-0.1.11 lib/vector_utilities.rb
gosu_extensions-0.1.10 lib/vector_utilities.rb
gosu_extensions-0.1.9 lib/vector_utilities.rb
gosu_extensions-0.1.8 lib/vector_utilities.rb