JSFiddle - React, Tailwind, and code Playground

by kukicvladimir

JavaScript

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

  print(gameMode)
  //Find touches

  let touch = touches.first
  if let location = touch?.location(in: self) {
    let theNodes = nodes(at: location)

    //Loop through nodes and find locations
    for node in theNodes {


      if node.name == "level" {       
        verticalGameTapped()
      }



      if node.name == "pauseButton" {

      }

      if node.name == "homeButton" {


        let nextScene = GameOverScene(fileNamed: "StartScene")

        nextScene?.scaleMode = .aspectFill

        self.scene?.view?.presentScene(nextScene!, transition: SKTransition.fade(withDuration: 0))
      }
    }
  }
}