Basically, I want to move the character (player) and want to follow the "camera" or the scene in the world. The problem is that a camera node is not created in Apple / Xcode, and if I try to move the scene, then I get an error saying something under the influence of "SKScene". I just do not want to take the background and lock the player around in the place because I want to be able to implement the forces for the player node. I went to the website of Apple's Advanced Sean Processing page and followed the example but it does not work. I should cover with a nudge in the right direction!
code:
(I have removed the pieces of code that are irrelevant)
class PlayScene: on SKScene cannonRotation = 0.0 bridesmaid remove = false override function didMoveToView (see: SKView) allow {physicsWorld.contactDelegate = self self.anchorPoint = CGPoint (X :, SKPhysicsContactDelegate {world = SKNode () player = SKShapeNode (25 circleOfRadius) 0.5, y : 0.5) self.addChild (world) // adds background to the world // adds the elements of visual player.fillColor = UIColor.whiteColor () player.position = CGPoint (X: CGRectGetMidX (self.frame), Y: CGRectGetMinY (self.frame) + 65 + 25) play er.zPosition = 2 player.physicsBody = SKPhysicsBody (circleOfRadius ?? 25) player.physicsBody .dynamic = true player.physicsBody .restitution = 0.9 player.physicsBody .categoryBitMask = BodyType.player.rawValue // Adds GameScene physicsGround let physics properties = SKPhysicsBody (edgeFromPoint: CGPoint (X: CGRectGetMinX (self.frame), Y: CGRectGetMinY (self.frame) +65), Topoint: CGPoint (X: CGRectGetMaxX (self.frame), Y: CGRectGetMinY (self.frame) + 65)) Self {powerlevel () totalPower = powerReached * playCannon.powerMultiplier self.addChild player.physicsBody .applyImpulse (CGVector (dx? Function touchesEnded (: NSSet, withEvent event UIEvent touches): .physicsBody = physicsGround} override CGFloat (float (TotalPower) * Cosf (float (cannonRotation))), sub: CGFloat (float (TotalPower) * Sinf (float (cannonRotation)) ))) fired = true}