Simultaneous Actor Spawning and Particle Engine?
I'm working on a Space Invaders style game, and I find myself in need of a few effects. First, I need to populate the entire screen with stars at random position and moving at random speeds towards the bottom of the screen. My first thought was to use particles, however I like my stars to twinkle, and I could find no way to randomly vary the color of particles over each particle's lifetime. I eventually resolved to use two hundred animated actors instead. Before you say anything, yes, the game is still running smoothly. However, for the life of me, I cannot find a behavior or set of behaviors for spawning large numbers of actors SIMULTANEOUSLY. If I can't spawn actors simultaneously, I'll need to obscure the star field from the player until it is set up. I can do this with an additional fake loading screen, but I would rather not.
Second, I need to create explosions: large numbers of particle spawned simultaneously, but each moving in a random direction. For the life of me, I cannot get the particles to spawn with different trajectories. I only ever see one particle, which I assume must have the 99 other particles hiding directly beneath it. Rapidly rotating the emitter actor only gives me five or six individually visible particles at most. There must be a way to emit hundreds of particles in all directions, simultaneously.
Any insights or suggestions would be greatly appreciated. I did a number of forum searches beforehand, but the results were unsatisfactory.
Second, I need to create explosions: large numbers of particle spawned simultaneously, but each moving in a random direction. For the life of me, I cannot get the particles to spawn with different trajectories. I only ever see one particle, which I assume must have the 99 other particles hiding directly beneath it. Rapidly rotating the emitter actor only gives me five or six individually visible particles at most. There must be a way to emit hundreds of particles in all directions, simultaneously.
Any insights or suggestions would be greatly appreciated. I did a number of forum searches beforehand, but the results were unsatisfactory.
Comments
Put your particle actor approx. 380 Y (if for iPhone) i.e outside of the screen. In the particles behaviour, try the following (obviously change a few parameters as an experiment to see what you like best):
Spawn Rate: 200 Particle Startup: 2 Particle Lifetime 8
Vel/Pos: Direction: random(221,330) relative to actor Speed 50, affected by gravity on
Size 15 Size changes to 2 Duration 4 secs
Color: experiment with blending options maybe
Rotation initial 60 Angular Vel. 140
As for moving in random directions for your explosions, in the Velocity/Position tab, put Direction as random(0,360) (or technically, random(0,359) but both work the same...) and experiment with that. Hope that helps. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
As the mask rotates from its center, rather quickly, stars "appear" and "disappear" by means of the holes in the mask - thus producing a twinkling effect.
It's an old "mechanical" star trick used at amusement parks and the like.
Psmith
I see that the direction of particles coming from an emitter can be randomized, but the effect is still more like a spinning sprinkler. A firework bursts from nothing, points of light spreading out in a spherical fashion before twinkling out. I can live without the twinkling, really- or use circular masks constrained to the firework emitters' locations- but I would really need the particles to burst as one in every direction for the effect to work.
I'll keep tinkering.