-
Particle Playground and Expressions Help
So I’m probably biting off more than I can chew, but I’m trying to learn the Particle Playground and expressions at the same time.
Ultimately, I’m trying to create an overhead scene with many birds (the particles) randomly flying (crisscrossing) through the frame (picture the original Legend of Zelda meets Hitchcock’s Birds). The problem I’m facing, is how to create expressions that (a) randomly position the Particle Playground’s cannon just outside of the frame (the birds need to fly in from random “elsewheres”) and (b) control the cannon’s direction so it generally fires into the frame (i.e. – if the cannon is off frame right, it should shoot leftish). If this wasn’t enough, I would also ideally like the particles to randomly “die” (disappear).
My clumsy attempt at part (a) is below. While it seems to work (the cannon remains out of the frame, which is 720 x 534), (a) i know the code is super crude and (b) some of the particles are still “born” within the frame, despite the cannon being off screen.
If anyone can offer any help, suggest a different approach, or turn me towards a tutorial that might help, it would be great.
thank you in advance.
a = random(-20,740);
b = random(-20,554);
if ( ( (a < 720) && (a > 0) ) && ( (b < 534) && (b > 0) ) ) {
while ( ( (a < 720) && (a > 0) ) && ( (b < 534) && (b > 0) ) ) {
a = random(-20,740);
b = random(-20,554);
}
}
[a,b]