Sha256: aacea2b1fd4546a72c33c11dde49d175571d4a3cafb78eadabdc3a8a75f528a4

Contents?: true

Size: 200 Bytes

Versions: 33

Compression:

Stored size: 200 Bytes

Contents

# Any object that is targetable.
#
module Targetable extend Trait
  
  # Distance from the potential shooter.
  #
  def distance_from shooter
    (self.position - shooter.position).length
  end
  
end

Version data entries

33 entries across 33 versions & 1 rubygems

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