Class | Rubygame::Sprites::Group |
In: |
lib/rubygame/sprite.rb
|
Parent: | Array |
The Group class is a special container, based on Array, with supplemental methods for handling multiple Sprite objects. Group can draw, update, and check collision for all its member sprites with one call.
All members of a Group must be unique (duplicates will be refused), and should be a Sprite (or functionally equivalent).
Check collision between each member of the Group and sprite. Returns an Array of all member sprites that collided with sprite. If none collided, returns an empty Array.
Draw every sprite on Surface dest. Calls Sprite#draw for every member sprite, passing dest as the argument. See also call and update.
Update every member sprite. Calls Sprite#update for every member sprite, passing on all arguments. See also call and draw.