So this is my situation.
I have emitters spawning from the top of the screen and travelling to the bottom of the screen and I'm trying to get a png image to follow them (for hit detection purposes)
The problem is that I need to have the PNG images live update to track the skemitternode and because I am generating several instances of the emitter node I can't make them global variables (need a new localized set for n instances)
So the solution I have come up with is to have a while loop that continues to update the PNG to the emitter nodes coordinates. The conditions of the loop would be to continue while the number of particles is less than 500 (the particle lifetime I have set).
I am having trouble getting the png image to stay with the skemitter node. It always goes above it or looses tracking.
Currently I am using:
while (particle < 5000) {
enemySmoke.position = Enemy.position
particle++
}
Where enemySmoke is the SKEmitter node travelling down the Y axis
var action = SKAction.moveToY(SH-SH, duration: 10 - duration)
// Basically moving to bottom of screen faster with each spawn as I have
// duration variable incrementing.
enemySmoke.runAction(SKAction.repeatActionForever(action))
Enemy.runAction(SKAction.repeatActionForever(action))
How can I get the emitter and the png to remain on each other?