Whatsup CodeCrew,
Over the last year I developed a small Space Asteroid shooter. I made it with one set of Graphics. What I wanna do now is add a way to select different skins. So that the user can basically either use them for free or pay for new ones.
How would I got about writing the code for example that when the user selects a specific skin that it actually uses all the graphics associated with that. For example, right now the player gfx code looks like this:
// MARK: Player
player = SKSpriteNode(imageNamed: “playerShip”)
player.setScale(1) // Player Size
player.position = CGPoint(x: self.size.width / 2, y: 0 - player.size.height)
player.zPosition = 2
player.physicsBody = SKPhysicsBody(rectangleOf: player.size)
player.physicsBody!.affectedByGravity = false
player.physicsBody!.categoryBitMask = physicsCategories.player
player.physicsBody!.collisionBitMask = physicsCategories.none
player.physicsBody!.contactTestBitMask = physicsCategories.enemy
self.addChild(player)
As you can see I have a specific SKSpriteNode. What I was thinking of doing is adding in playerShip2, 3, 4, 5 and so on and then depending on what skin the user has selected it will use that set of graphics.
I would really appreciate your help on this CodeCrew or Chris!
Thanks in advance