Method: Rect#collide_array_all

Defined in:
lib/gamebox/lib/rect.rb

#collide_array_all(array_rects) ⇒ Object

Iterate through all elements in the given Array, and return an Array containing the indices of every element that is a Rect that collides with the caller.



482
483
484
485
486
487
488
489
490
# File 'lib/gamebox/lib/rect.rb', line 482

def collide_array_all(array_rects)
  indexes = []
  for i in (0...(array_rects.length))
    if array_rects[i].collide_rect?(self)
      indexes += [i]
    end
  end
  return indexes
end