//
//  MenuScene.swift
//  GoldWars
//
//  Created by Alsen Duraki on 18.04.20.
//  Copyright © 2020 SP2. All rights reserved.
//

import SpriteKit

class MenuScene: SKScene {
    
    var startGameButtonNode:SKSpriteNode!
    var settingsButtonNode:SKSpriteNode!

    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        guard let touch = touches.first else {
            return
        }
        let gameScene = GameScene(size: self.size)
        let location = touch.location(in: self)
        let frontTouchedNode = atPoint(location).name
        
        let transition = SKTransition.moveIn(with: .right, duration: 1)
        
        if frontTouchedNode == "startGameBtn" || frontTouchedNode == "tmpStartGameLbl"{
            self.view?.presentScene(gameScene, transition: transition)
        }
        
        if frontTouchedNode == "settingsBtn" || frontTouchedNode == "tmpSettingsLbl"{
            //TODO: Implement settings functionality
        }
    }

}
