Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/chingu/core_ext/array.rb

Direct Known Subclasses

Chingu::Rect

Instance Method Summary collapse

Instance Method Details

#each_at(x, y) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/chingu/core_ext/array.rb', line 27

def each_at(x, y)
  self.each do |object|
    object.each_at(x, y) do |obj|
      yield obj
    end
  end
end

#each_bounding_box_collision(*klasses) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/chingu/core_ext/array.rb', line 19

def each_bounding_box_collision(*klasses)
  self.each do |object1|
    object1.each_bounding_box_collision(*klasses) do |object1, object2|
      yield object1, object2
    end
  end
end

#each_bounding_circle_collision(*klasses) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/chingu/core_ext/array.rb', line 11

def each_bounding_circle_collision(*klasses)
  self.each do |object1|
    object1.each_bounding_circle_collision(*klasses) do |object1, object2|
      yield object1, object2
    end
  end    
end

#each_collision(*klasses) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/chingu/core_ext/array.rb', line 3

def each_collision(*klasses)
  self.each do |object1|
    object1.each_collision(*klasses) do |object, object2|
      yield object, object2
    end
  end
end