I just started a project and add the following lines of code:
override func didMoveToView(view: SKView) {
let myNode = SKNode()
myNode.position = CGPoint(x: 250.0, y: 300.0)
addChild(myNode)
let mySprite = SKSpriteNode(imageNamed: "Spaceship")
mySprite.position = CGPoint(x: 0, y: 0)
mySprite.zPosition = 1
myNode.addChild(mySprite)
let myOtherSprite = SKSpriteNode(imageNamed: "Spaceship")
myOtherSprite.position = CGPoint(x: 50.0, y: 50.0)
myOtherSprite.zPosition = 2
myNode.addChild(myOtherSprite)
}
but the sprites don't appear in the scene. What's the problem here? I checked my code several times, and I think there are no errors.