     /// 倒计时秒数
     var countdown : Int = 60
     
+    /// 块宽度
     var tileWidht : CGFloat = 0
-    var tileNum : Int = 0
+    
+    /// 块数量
+    var tileCount : Int = 0
+    
+    /// 颜色
+    var colorA : UIColor!
+    var colorB : UIColor!
+    
+    /// 随机颜色的位置
+    var ranmodColorIndex : Int = 0
     
     // MARK: -
     

        // 根据不同屏幕决定方块数量和大小
        if Device.IS_3_5_INCHES() {
            tileWidht = 56.0
            tileNum = 20
        }else if Device.IS_4_INCHES() {
            tileWidht = 60.0
            tileNum = 24
        }else if Device.IS_4_7_INCHES() {
            tileWidht = 63.0
            tileNum = 28
        }else if Device.IS_5_5_INCHES() {
            tileWidht = 63.0
            tileNum = 40
        }
    }

    override func didReceiveMemoryWarning() {

    func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        var cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! UICollectionViewCell
        
        if indexPath.row == self.ranmodColorIndex {
            cell.backgroundColor = colorB;
        }else{
            cell.backgroundColor = colorA;
        }

        return cell
    }
    
    func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
        if indexPath.row == self.ranmodColorIndex {
            
            level = level + 1
            
            scoreLabel.text = "\(level)"
            
            self.GenerateColorForLevel(level);
            
            // reload CollectionView (使用 reloadSections 会有个默认渐显动画)
            tileCollectionView.reloadSections(NSIndexSet(index: 0))
        }
    }
    
    // MARK: -
