I am trying to do some fairly simple SKShapeNode math to set the position of a shape node. It looks like this:
for var i = 0; i < 6; i++ {
var pip: Pip = pips[i]
// set position
let x: CGFloat = tray2.frame.size.width - (i + 1) * pip.frame.size.width - (i + 1) * 2
let y: CGFloat = tray2.frame.size.height - pip.frame.size.height - 1
pip.position = CGPointMake(x, y)
tray2.addChild(pip)
}
However, in the 'let x...' line, an error is produced: "NSNumber is not a subtype of UInt8". What am I doing wrong here?