     func drawCube(#color: NSColor, skip: Int)
     {
         let (w, h) = cubeSize()
+        
         let s = h/2
         let x = pos.x*w
         let y = (pos.x%2 == 0) ? (pos.y*h) : (pos.y*h - h/2)

        super.init(coder: aDecoder)
    }
    
    override func hasConfigureSheet() -> Bool {
        return false
    }

    override func startAnimation() {
        super.startAnimation()
        setup()
        setAnimationTimeInterval(1.0 / 30.0)
        needsDisplay = true
    }
    
    override func stopAnimation() {
        super.stopAnimation()
    }
    
    func width() -> Int {
        return Int(bounds.size.width)
    }
    func height() -> Int {
        return Int(bounds.size.height)
    }
    func randint(n: Int) -> Int {
        return Int(arc4random_uniform(UInt32(n)+1))
    }
    
    func setup() {


                pos.y += 1
            
        case 1: // right
                if (x%2)==1 { y -= 1 }
                x += 1

        case 2: // left
                if (x%2)==1 { y -= 1 }
                x -= 1

        case 3: // down
                pos.y -= 1
                skip = 0 // dont paint top

        case 4: // back left
                if (x%2)==0 { y += 1 }
                x -= 1
                skip = 2 // dont paint right

        case 5: // back right
                if (x%2)==0 { y += 1 }
                x += 1
                skip = 1 // dont paint left
            
        default:
                break
        }

