Sha256: 370288e669ef012ab7d4077ae6442a94fe57bfccf838776d9eedfc9629068e0c
Contents?: true
Size: 536 Bytes
Versions: 9
Compression:
Stored size: 536 Bytes
Contents
# Holds the things that are drawn. # class Sprites def initialize elements = [] @elements = elements @to_remove = [] end def register element @elements << element end def registered? element @elements.include? element end def move @elements.each &:move end def draw @elements.each &:draw end def remove object @to_remove << object end # # def remove_marked @to_remove.each do |object| @elements.delete object end @to_remove.clear end end
Version data entries
9 entries across 9 versions & 1 rubygems