//
//  MainMenuView.swift
//  DouShouQi_App
//
//  Created by Nathan Verdier on 26/05/2024.
//

import SwiftUI
import SpriteKit

struct GameView: View {
    var gameScene : GameScene = GameScene(size: CGSize(width: 700, height: 900))
    var body: some View {
        VStack {
            TopGameBoard().frame(maxHeight: 200)
            SpriteView(scene: gameScene)
        }
        .onAppear {
            MusicPlayer.shared.playBackgroundMusic(music: "GameMusic")
        }
        .onDisappear {
            MusicPlayer.shared.stopBackgroundMusic()
        }
    }
}

struct GameView_Previews: PreviewProvider {
    static var previews: some View {
        GameView()
    }
}
