Class: Chingu::Particle

Inherits:
GameObject show all
Defined in:
lib/chingu/particle.rb

Instance Attribute Summary

Attributes inherited from GameObject

#angle, #center, #center_x, #center_y, #color, #factor, #factor_x, #factor_y, #image, #mode, #x, #y, #zorder

Attributes inherited from BasicGameObject

#options, #parent, #paused, #visible

Instance Method Summary collapse

Methods inherited from GameObject

#distance_to, #draw, #inside_window?, #outside_window?

Methods included from Helpers::RotationCenter

#rotation_center

Methods included from Helpers::InputClient

#input, #input=

Methods inherited from BasicGameObject

all, create, #destroy, destroy_all, destroy_if, #draw, #draw_trait, has_trait, has_traits, #hide!, #pause!, #setup_trait, #show!, size, #unpause!, #update_trait

Constructor Details

#initialize(options) ⇒ Particle

Returns a new instance of Particle.



10
11
12
13
# File 'lib/chingu/particle.rb', line 10

def initialize(options)
  super({:mode => :additive}.merge(options))
  @animation = options[:animation] || nil      
end

Instance Method Details

#updateObject



15
16
17
18
# File 'lib/chingu/particle.rb', line 15

def update
  super
  self.image = @animation.next!   if @animation
end