Hello, I am on the first part of chapter 2, pg 60. I am not able to get the zombie to move at all. Can some one tell me if I have the code wrong. I have been stuck on this for hours. I want to figure it out before I move onto the next part.
import SpriteKit
class GameScene: SKScene {
let zombie = SKSpriteNode(imageNamed: "zombie1")
override func didMoveToView(view: SKView) {
backgroundColor = SKColor.blackColor()
let background = SKSpriteNode(imageNamed: "background1")
background.position = CGPoint(x: size.width/2, y: size.height/2)
background.anchorPoint = CGPoint(x: 0.5, y: 0.5) // Default
// background.zRotation = CGFloat (M_PI) / 8
background.zPosition = -1
addChild(background)
let mySize = background.size
print("size: \(mySize)")
let zombie = SKSpriteNode(imageNamed: "zombie1")
zombie.position = CGPoint(x:400, y: 400)
//zombie.setScale(2.0)
addChild(zombie)
}
override func update(currentTime: NSTimeInterval) {
zombie.position = CGPoint(x: zombie.position.x + 8, y: zombie.position.y)
}
}