Class: DamageGraphics

Inherits:
Component show all
Defined in:
lib/entities/components/damage_graphics.rb

Instance Attribute Summary

Attributes inherited from Component

#object

Instance Method Summary collapse

Methods inherited from Component

#update

Constructor Details

#initialize(object_pool) ⇒ DamageGraphics

Returns a new instance of DamageGraphics.



2
3
4
5
6
# File 'lib/entities/components/damage_graphics.rb', line 2

def initialize(object_pool)
  super
  @image = images.sample
  @angle = rand(0..360)
end

Instance Method Details

#draw(viewport) ⇒ Object



8
9
10
# File 'lib/entities/components/damage_graphics.rb', line 8

def draw(viewport)
  @image.draw_rot(x, y, 0, @angle)
end