-
Notifications
You must be signed in to change notification settings - Fork 12
/
Game_2048App.swift
43 lines (39 loc) · 1.06 KB
/
Game_2048App.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import SwiftUI
@main
struct Game_2048App: App {
var body: some Scene {
WindowGroup {
LaunchScreen()
}
}
}
struct LaunchScreen: View {
@State private var isActive = false
var body: some View {
if isActive {
GameView()
} else {
VStack {
Text("2048")
.font(.largeTitle)
.fontWeight(.bold)
.foregroundColor(.black)
.padding()
Text("Join the numbers and get to the 2048 tile!")
.font(.headline)
.foregroundColor(.black)
.padding()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.white)
.edgesIgnoringSafeArea(.all)
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
withAnimation {
self.isActive = true
}
}
}
}
}
}