You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.4 KiB
74 lines
2.4 KiB
//
|
|
// MainMenuView.swift
|
|
// DouShouQiIOS
|
|
//
|
|
// Created by Pierre FERREIRA on 21/05/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
import DouShouQiModel
|
|
|
|
|
|
struct MainMenuView: View {
|
|
@Environment(\.colorScheme) var colorScheme
|
|
|
|
var gamevm : GameVM = GameVM(withGame: try! Game(withRules: ClassicRules(),
|
|
andPlayer1: Player(withName: "Meruemu", andId: .player1)!,
|
|
andPlayer2: Player(withName: "Kumogi", andId: .player2)!),
|
|
andScene: GameScene(size: CGSize(width: 940, height: 740)))
|
|
|
|
|
|
var body: some View {
|
|
NavigationStack {
|
|
|
|
ZStack {
|
|
Rectangle().fill(Color.bgColor).ignoresSafeArea()
|
|
VStack {
|
|
Image("DouShouQi")
|
|
.resizable()
|
|
.aspectRatio(contentMode: .fit)
|
|
.frame(width: 200, height: 200)
|
|
|
|
|
|
Text("DouShouQi")
|
|
.font(.largeTitle)
|
|
.bold()
|
|
.padding()
|
|
|
|
//NavButton("Jouer Seul", destinationView: {PlayerSelect(versus: false)})
|
|
NavButton("Jouer Seul", destinationView: {GameView(gameVM: gamevm)})
|
|
.padding(.top, 10)
|
|
|
|
NavButton("Jouer en Multi", destinationView: {PlayerSelect(versus: true)})
|
|
|
|
|
|
NavButton("Leaderboard", destinationView: {PlayerListView()})
|
|
.padding(.top, 20)
|
|
|
|
Button(action: {
|
|
// Quitter
|
|
print("Quitter tapped!")
|
|
}
|
|
) {
|
|
Text("Quitter")
|
|
.font(.title2)
|
|
.padding()
|
|
.foregroundColor(.fontColor)
|
|
}.overlay(
|
|
RoundedRectangle(cornerRadius: 10)
|
|
.stroke(Color.primaryColor, lineWidth: 3)
|
|
)
|
|
.padding(.top, 20)
|
|
|
|
}.navigationBarBackButtonHidden(true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct MainMenuView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
MainMenuView()
|
|
}
|
|
}
|