La méthode .removeFromParent() ne supprime pas le sprite. Quel est le problème ?
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
guard touches.first != nil else {
return
}
let myShot = SKSpriteNode()
let myShotAnimation = SKAction.repeatActionForever(SKAction.animateWithTextures(myShotTexture, timePerFrame: 0.01))
myShot.size = CGSizeMake(200, 200)
myShot.anchorPoint = CGPoint(x: 0.5, y: 0.5)
myShot.zPosition = 0
sprite!.addChild(myShot)
let myShotAction = SKAction.group([SKAction.scaleBy(0.1, duration: 0.5), myShotAnimation])
let actionRemove = SKAction.removeFromParent()
myShot.runAction (SKAction.sequence([myShotAction, actionRemove]))
}
Le sprite "myShot" avec animation ne disparaît pas