You must make your own logic, which takes place in touchesMoved(), using the global / member variable.
Unfortunately, a lot of gamedev and SK are mathematics and logic. You have to come up with your problems and solutions. There is no manual, because the possibilities in programming and Swift are endless :)
:
, touch , " ", .
, , 0,0 ( , ). , 25, 0... " " + 25x.
delta , moveBy ... , X +25, ( , ). deltaX -25, .
, update() touchesMoved(), deltaX.
, ... , :
for touch in touches {
myGlobalDeltaX = myDeltaXFunc(currentTouch: touch)
myMoveFunc(cards: allTheCards, byDeltaX: myGlobalDeltaX)
- Delta, , .
- myMoveFunc - , , .moveBy .
:
, , touchesEnded() update() , / node ... -
let centerX = self.frame.midX
let centerY = self.frame.midY
let center = CGPoint(x: centerX, y: centerY)
let centerNode = self.nodes(at: center)
, centerX centerY , , :) , .
centerNode, , , "" .
let selectedCard = centerNode
mySelectionFunc(middleCard: selectedCard)
, , . , .
mySelectionFunc(middleCard: self.nodes(at: CGPoint(x: self.frame.x, y: self.frame.y)))
, !