2017-03-24 2 views
0

MenuScene에서 GameScene으로 장면 전환을 시도하고 있습니다. 나는 여기에 갇혀있다. GameScene 클래스를 완성 했으므로이 오류가 왜 여기에 있는지 확신 할 수 없습니다.인수 레이블 '(fileNamed :)'과 사용 가능한 오버로드가 일치하지 않습니다.

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { 

     for touch in touches { 
      let location = touch.location(in: self) 

      if atPoint(location).name == "Play" { 
       let scene = GameScene(fileNamed: "GameSene") //error 
       scene?.scaleMode = .aspectFill 

       self.view?.presentScene(gameplay!, transition: SKTransition.doorway(withDuration: 1)) 

      } 

      if atPoint(location).name == "Highscore" { 
       scoreLabel.removeFromParent() 
       createLabel() 

      }} 
+0

유형'GameScene ('로 작동하고 엑스 코드에서 알 수 무엇을 보일 것입니다. – vadian

+0

오류는 무엇입니까? 또한'GameScene' 코드를 우리와 공유 할 수 있습니까? – Fahim

+0

아마 Scene = GameScene (fileNamed : "GameSene")에 오타가있을 수 있습니다. 아마도 GameScene 이거나 GameScene.sks 파일을 만들지 않았을 것입니다. –

답변

0

나는 티,이 오류를 다시 만들 수 있습니다 내가로 전환하려고 내 장면은 해당 SKS 파일을 가지고 있으며, 나는

override init(size: CGSize) { 
    super.init(size: size) 

required init?(coder aDecoder: NSCoder) { 
    fatalError("init(coder:) has not been implemented") 
} 
이있을 때

초기화를

override func didMove(to view: SKView) 

super.init 

제거하고 모든 계획