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, #height, #image, #mode, #width, #x, #y, #zorder

Attributes inherited from BasicGameObject

#options, #parent, #paused, #visible

Instance Method Summary collapse

Methods inherited from GameObject

#alpha, #alpha=, #attributes, #attributes=, #distance_to, #draw, #draw_at, #draw_relative, #filename, #hide!, #inside_window?, #outside_window?, #show!, #size, #size=, #visible?

Methods included from Helpers::RotationCenter

#rotation_center, #rotation_center=

Methods included from Helpers::InputClient

#holding?, #input, #input=

Methods inherited from BasicGameObject

all, create, #destroy, destroy_all, destroy_if, #draw, #draw_trait, initialize_trait, #pause!, #paused?, #setup, #setup_trait, size, trait, #trait_options, traits, #unpause!, #update_trait

Methods included from Helpers::ClassInheritableAccessor

included

Constructor Details

#initialize(options) ⇒ Particle

Returns a new instance of Particle.



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

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

Instance Method Details

#updateObject



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

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