Class: DamageGraphics
- Defined in:
- lib/entities/components/damage_graphics.rb
Instance Attribute Summary
Attributes inherited from Component
Instance Method Summary collapse
- #draw(viewport) ⇒ Object
-
#initialize(object_pool) ⇒ DamageGraphics
constructor
A new instance of DamageGraphics.
Methods inherited from Component
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() @image.draw_rot(x, y, 0, @angle) end |