(iBooks / ePub version, so left the page number out)
SKAction.move() has the following method signature:
let actionMidMove = SKAction.move(by: CGVector, duration: TimeInterval)
The code sample in the book reads as follows:
let actionMidMove = SKAction.moveBy(x: -size.width/2-enemy.size.width/2, y: -playableRect.height/2 + enemy.size.height/2, duration: 1.0)
This has the following compile errors:
-Expected expression in list of expressions
-Expected ā;ā separator
Use of unresolved identifier āxā
Clearly there is some syntax error in the code, but Iām not sure how to define the vector here? Perhaps when the book was written the method had a different signature? It appears to me a CGPoint is being passed in when a CGVector is what is expected.