Skip to content

Instantly share code, notes, and snippets.

@efrenjgb
Last active August 29, 2015 14:19
Show Gist options
  • Save efrenjgb/e1f63606e126c1de20f6 to your computer and use it in GitHub Desktop.
Save efrenjgb/e1f63606e126c1de20f6 to your computer and use it in GitHub Desktop.
self.backgroundColor = SKColor.blackColor()
let starFieldEmmiter = SKEmitterNode(fileNamed: "StarField.sks")
starFieldEmmiter.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMaxY(self.frame))
starFieldEmmiter.zPosition = -20
starFieldEmmiter.advanceSimulationTime(NSTimeInterval(starFieldEmmiter.particleLifetime))
self.addChild(starFieldEmmiter)
let starship = SKSpriteNode(imageNamed:"Spaceship")
starship.xScale = 0.2
starship.yScale = 0.2
starship.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMinY(self.frame) + 100)
self.addChild(starship)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment