ios - SKEmitterNode change particle speed to particles already emitted -
Is it possible to change the speed of the particles already emitted? SKEmitterNode has a particle-spitted property, but it only applies to particles that will be emitted in the future.
For example, suppose we are building a spacecraft simulator. Imagine the spacecraft above a starfield. Starfield was created through a particle file, which was provided using SKEmitterNode. Through this simulation the spacecraft never changes the situation. SKEmitterNode is made of particles which proceeds at a constant angle of 10 in the negative x direction. To speed up the spacecraft, it would be good to keep the ability to change the motion of already emitted particles, to simulate. As of now, if the motion of the particles is to be changed, then the particles already emitted will be slow in comparison to the particles emitted after the speed change.
Defining a solution is a particle system that emits in a range of particles, for example, with 100 x 100 0 speed and 0 acceleration. This particle system will be provided with a low zPosition value to stay in the background. To simulate the spacecraft movement, SKEmitterNode's X position will change relative to the speed of the spacecraft. The closure of the more SKEmitterNodes view is added, then the old SKEmitterNodes are scrolled in view of the closed roll and removed.
I have tested that solution and it works, but I was curious that anyone had a more elegant solution.
You can probably create a second SKEmitterNode
whose same style is fast With speed then run the SKAction
or SKAction sequence
for transition between 2.
Comments
Post a Comment