Class: CP::Space

Inherits:
Object
  • Object
show all
Defined in:
lib/chipmunk.rb

Instance Method Summary collapse

Instance Method Details

#add_object(obj) ⇒ Object


91
92
93
# File 'lib/chipmunk.rb', line 91

def add_object(obj)
  obj.chipmunk_objects.each{|elt| elt.add_to_space(self)}
end

#add_objects(*objs) ⇒ Object


95
96
97
# File 'lib/chipmunk.rb', line 95

def add_objects(*objs)
  objs.each{|obj| add_object(obj)}
end

#remove_object(obj) ⇒ Object


99
100
101
# File 'lib/chipmunk.rb', line 99

def remove_object(obj)
  obj.chipmunk_objects.each{|elt| elt.remove_from_space(self)}
end

#remove_objects(*objs) ⇒ Object


103
104
105
# File 'lib/chipmunk.rb', line 103

def remove_objects(*objs)
  objs.each{|obj| remove_object(obj)}
end