class Damage
Constants
- MAX_INSTANCES
Public Class Methods
new(object_pool, x, y)
click to toggle source
Calls superclass method
GameObject::new
# File lib/entities/damage.rb, line 5 def initialize(object_pool, x, y) super DamageGraphics.new(self) track(self) end
Public Instance Methods
effect?()
click to toggle source
# File lib/entities/damage.rb, line 11 def effect? true end
Private Instance Methods
track(instance)
click to toggle source
# File lib/entities/damage.rb, line 17 def track(instance) if @@instances.size < MAX_INSTANCES @@instances << instance else out = @@instances.shift out.mark_for_removal @@instances << instance end end