This repository has been archived on 2019-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
particles/emitter.rb
Alexander Yakovlev 9124fe464b Initial commit
Вместо змея пока что шарики, но и то хорошо
2012-12-21 18:54:30 +07:00

21 lines
418 B
Ruby

# An emitter simply emits particles at a regular interval. In this case, every
# time spawn is called, a new particle is generated with a random angle of movement and speed.
class Emitter
def initialize(particles)
@particles = particles
end
def spawn (x, y)
@particles.create(x, y, rand * 360, (rand * 3)+3)
end
def draw
@particles.draw
end
def update
@particles.update
end
end