0
我試圖創建一個if語句,當得分高於當前最高分時得到高分。這是我的代碼:當分數高於目前的高分時,做出高分?
if scoreColorGame.score > scoreColorGame.highScore {
scoreColorGame.score = scoreColorGame.highScore
print(scoreColorGame.highScore)
}
每當我跑這scoreColorGame.highScore
總是等於0。我已籤,如果語句是肯定運行,但這樣的:
scoreColorGame.score = scoreColorGame.highScore
不工作?