Class: Core::Particles

Inherits:
Object show all
Defined in:
lib/particles.rb

Instance Method Summary collapse

Constructor Details

#initialize(str, x = 0, y = 0) ⇒ Particles

Returns a new instance of Particles.



13
14
15
16
# File 'lib/particles.rb', line 13

def initialize(str, x=0, y=0)
  @emitter = Core.particles[str].dup
  @emitter.x, @emitter.y = x, y
end

Instance Method Details

#draw(xoff = 0, yoff = 0) ⇒ Object



32
33
34
# File 'lib/particles.rb', line 32

def draw(xoff=0, yoff=0)
  @emitter.draw(xoff, yoff)
end

#gravity=(g) ⇒ Object



26
27
28
# File 'lib/particles.rb', line 26

def gravity=(g)
  @emitter.gravity = g
end

#updateObject



29
30
31
# File 'lib/particles.rb', line 29

def update
  @emitter.update
end

#wind=(w) ⇒ Object



23
24
25
# File 'lib/particles.rb', line 23

def wind=(w)
  @emitter.wind = w
end

#x=(x) ⇒ Object



17
18
19
# File 'lib/particles.rb', line 17

def x=(x)
  @emitter.x = x
end

#y=(y) ⇒ Object



20
21
22
# File 'lib/particles.rb', line 20

def y=(y)
  @emitter.y = y
end