gongchengxiaofendui / Game-2048

团队作业
1 stars 0 forks source link

分数 #7

Closed gyf-lancelot closed 8 years ago

gyf-lancelot commented 9 years ago
  1. 设置分数label
  2. 分数变更
gyf-lancelot commented 8 years ago

func changeScore(s:Int) { score += s if(bestscore < score) { bestscore = score } scoredelegate.changeScore(value: score) bestscoredelegate.changeScore(value: score) } 分数变更。

gyf-lancelot commented 8 years ago

func setupScoreLabels() { score = ScoreView() score.frame.origin.x = 50 score.frame.origin.y = 80 score.changeScore(value: 0) self.view.addSubview(score)

    bestscore = BestScoreView()
    bestscore.frame.origin.x = 170
    bestscore.frame.origin.y = 80
    bestscore.changeScore(value: 0)
    self.view.addSubview(bestscore)
}

设置分数label和最高分label