修复连击问题
This commit is contained in:
@@ -109,7 +109,8 @@ struct ContentView: View {
|
||||
runClock()
|
||||
}
|
||||
|
||||
func timeOut() {
|
||||
func timeOut(for emoji: [String]) {
|
||||
guard currentEmoji == emoji else { return }
|
||||
if gameState == .player1Answering {
|
||||
player1Score -= 1
|
||||
} else if gameState == .player2Answering {
|
||||
@@ -121,11 +122,11 @@ struct ContentView: View {
|
||||
|
||||
func runClock() {
|
||||
answerScale = 1
|
||||
|
||||
let checkEmoji = currentEmoji
|
||||
withAnimation(.linear(duration: answerTime)) {
|
||||
answerScale = 0
|
||||
} completion: {
|
||||
timeOut()
|
||||
timeOut(for: checkEmoji)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user