【发布时间】:2017-08-29 17:49:29
【问题描述】:
我想让我的宇宙飞船有一条跟随它的粒子轨迹。我该怎么做?
这是我的飞船代码:
override func didMove(to view: SKView) {
spaceS.position = CGPoint(x: self.frame.width / 2, y: self.frame.height / 2)
spaceS.setScale(0.05)
spaceS.zPosition = 1
addChild(spaceS)
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
let location = touch.location(in: self)
spaceS.position = CGPoint(x: location.x, y: location.y)
}
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
let location = touch.location(in: self)
spaceS.position = CGPoint(x: location.x, y: location.y)
}
}
编辑 1:更准确地说是火焰粒子轨迹
【问题讨论】:
标签: ios swift3 sprite-kit particles