|
|
|
@ -38,12 +38,12 @@ class SpriteMoople : SKNode {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override var isUserInteractionEnabled: Bool {
|
|
|
|
|
get { return true }
|
|
|
|
|
set {}
|
|
|
|
|
}
|
|
|
|
|
get { return refGameScene?.isGameOver == false }
|
|
|
|
|
set { }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
|
|
|
|
|
|
|
|
|
if isUserInteractionEnabled == false { return }
|
|
|
|
|
let movePoss: [ Move ] = refGameScene!.game.rules.getMoves(in: refGameScene!.game.board,of:refGameScene!.game.rules.getNextPlayer(),fromRow: Int(self.cellPosition.x),andColumn: Int(self.cellPosition.y))
|
|
|
|
|
for pos in movePoss {
|
|
|
|
|
let rect = SKShapeNode(rectOf: CGSize(width: 90, height: 90))
|
|
|
|
@ -56,10 +56,12 @@ class SpriteMoople : SKNode {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
|
|
|
|
|
if isUserInteractionEnabled == false { return }
|
|
|
|
|
self.position = touches.first?.location(in: parent!) ?? CGPoint(x: 0, y: 0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
|
|
|
|
if isUserInteractionEnabled == false { return }
|
|
|
|
|
let localisation = touches.first?.location(in: parent!)
|
|
|
|
|
|
|
|
|
|
// Clean rect
|
|
|
|
|