Class: Explosion

Inherits:
GameObject show all
Defined in:
lib/entities/explosion.rb

Instance Attribute Summary

Attributes inherited from GameObject

#components, #location, #x, #y

Instance Method Summary collapse

Methods inherited from GameObject

#box, #collide, #draw, #move, #on_collision, #removable?, #update

Constructor Details

#initialize(object_pool, x, y, source) ⇒ Explosion

Returns a new instance of Explosion.



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/entities/explosion.rb', line 3

def initialize(object_pool, x, y, source)
  super(object_pool, x, y)
  @source = source
  @object_pool = object_pool
  if @object_pool.map.can_move_to?(x, y)
    Damage.new(@object_pool, x, y)
  end
  ExplosionGraphics.new(self)
  ExplosionSounds.play(self, object_pool.camera)
  inflict_damage
end

Instance Method Details

#effect?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/entities/explosion.rb', line 15

def effect?
  true
end

#mark_for_removalObject



19
20
21
# File 'lib/entities/explosion.rb', line 19

def mark_for_removal
  super
end