I've been having a play with Swift today, I forked the FlappyBird clone and have been making a few changes, like adding collision detection.
I'd like to have some particles emitted when the bird hits the pipe, so I've done a bit of reading and found the SKEmitterNode class. However all the documentation is in Objective-C so I'm having to transpose it all to Swift as there's currently nothing online about how to use SpriteKit in Swift.
This is how I'm attempting to create the Emitter
// sparkles and burstEmitter are defined as class variables
sparkles = SKTexture(imageNamed: "bird-01") //reusing the bird texture for now
burstEmitter = SKEmitterNode()
burstEmitter.particleTexture = sparkles
burstEmitter.position = CGPointMake(200, 200)
burstEmitter.particleBirthRate = 20
burstEmitter.numParticlesToEmit = 200;
self.addChild(burstEmitter)
Does this look right?
When I build I don't see any particles on screen.
The full source of my fork is on github here - https://github.com/jolyonruss/FlappySwift
Thanks for any help