require "luascape.physics"


particleSystem = {}
function particleSystem.create()
  local node = rootNode.children:add(Node())
  
  local system = ParticleSystem()
  system.maxParticleCount = 10
  system.output = 20
  system.emitter.radius = 0
  system.velocity = Vector(0,2,0)
  system.velocityRange = Vector(0.5,0.5,0.5)
  system.gravity = Vector(0,-2,0)
  system.lifetime = 0.5
  system.alphaOutFading = true
  
  local crowd = QuadSpriteCrowd()
  local crowdNode = node.children:add(Node())
  crowdNode.visual = crowd
  crowd.controller = ParticleCrowdController(system, crowdNode)
  return node, system, crowd
end
