Posts

Post marked as solved
5 Replies
I replace the spawnBird() function and got rid of the call of setupBird(), but it gave me this errorVariable used within its own initial valueBut i manged to fix the issue anyway by adding frame.width/2.0 to the position of the bird, coin and obstacle which moves it to the end of the screen. bird.position = CGPoint(x: cameraRect.maxX + frame.width/2.0 + bird.frame.width, y: size.height/2.0 + birdHeight + random)
Post marked as solved
5 Replies
I have a function setupNode() where in which all my functions are listed then setupNode() is called at didMove function.override func didMove(to view: SKView){ setupNodes() }func setupNodes(){ //Other Functions setupBird() spawnBird() }