1
想製作一個類似於Paper.io的應用程序。我可以讓應用程序沿着它的路徑畫線。但無法創建封閉路徑。填充顏色的形狀像Paper.io
func action()
{
var action = SKAction()
switch direction {
case 1:
action = SKAction.moveBy(x:164,y:0,duration:0.6)
case -1:
action = SKAction.moveBy(x:-164,y:0,duration:0.6)
case 2:
action = SKAction.moveBy(x:0,y:164,duration:0.6)
case -2:
action = SKAction.moveBy(x:0,y:-164,duration:0.6)
default:
return
}
print("touch start ",posx,posy)
var repeatAction = SKAction.repeatForever(action)
ball.run(repeatAction, withKey: "Moving")
}