lib/lotu/systems/collision_system.rb in lotu-0.1.14 vs lib/lotu/systems/collision_system.rb in lotu-0.1.15
- old
+ new
@@ -1,10 +1,11 @@
module Lotu
- class CollisionSystem
+ class CollisionSystem < System
def initialize(user, opts={})
- user.extend UserMethods
+ super
+ @user.extend UserMethods
@entities = Hash.new{ |h,k| h[k] = [] }
@actions = {}
end
def add_entity(obj, tag)
@@ -26,11 +27,9 @@
blk.call(ent1, ent2) if ent1.collides_with(ent2)
end
end
end
end
-
- def draw;end
module UserMethods
def when_colliding(*args, &blk)
systems[CollisionSystem].when_colliding(*args, &blk)
end