Guest User

Untitled

a guest
Apr 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. func spawnBullet() {
  2. let bullet = SKShapeNode(circleOfRadius:30)
  3.  
  4. //set other properties here...
  5.  
  6. self.addChild(bullet)
  7.  
  8. }
  9.  
  10. var bulletNode: SKShapeNode?
  11.  
  12. func setBulletProperty() {
  13.  
  14. let bullet:SKShapeNode? = SKShapeNode(circleOfRadius: 30)
  15.  
  16. //set other properties here...
  17.  
  18. bulletNode = bullet
  19.  
  20. }
  21.  
  22. func spawnBullet() {
  23. let newBullet = bulletNode.copy() as! SKShapeNode
  24. self.addChild(newBullet)
  25. }
Add Comment
Please, Sign In to add comment