|
|
|
@ -23,17 +23,20 @@ class SpriteMeeple : SKNode {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
init(imageNamed imageName: String, size: CGSize, backgroundColor: UIColor){
|
|
|
|
|
init(imageNamed imageName: String, size: CGSize, backgroundColor: UIColor, imageRotation : Double = 0){
|
|
|
|
|
imageNode = SKSpriteNode(imageNamed: imageName)
|
|
|
|
|
imageNode.size = CGSize(width: 90, height: 90)
|
|
|
|
|
|
|
|
|
|
ellipseNode = SKShapeNode(ellipseOf: CGSize(width: 100, height: 100))
|
|
|
|
|
ellipseNode.fillColor = .yellow
|
|
|
|
|
ellipseNode.fillColor = backgroundColor
|
|
|
|
|
|
|
|
|
|
cellPosition = CGPoint(x: 0, y: 0)
|
|
|
|
|
|
|
|
|
|
super.init()
|
|
|
|
|
|
|
|
|
|
let radians = CGFloat(imageRotation * Double.pi / 180.0)
|
|
|
|
|
imageNode.zRotation = radians
|
|
|
|
|
|
|
|
|
|
//ellipseNode = SKShapeNode(ellipseOf: CGSize(width: imageNode.size.width, height: imageNode.size.height))
|
|
|
|
|
self.addChild(ellipseNode)
|
|
|
|
|
self.addChild(imageNode)
|
|
|
|
|