Hello all,
I’m creating a game where some particles are created after a collision between two objects. The particles are then given a random x and y velocity and they shoot out in every direction. I’ve been trying to alter the way the particles shoot out to resemble Figure 1, where the particles shoot out at a randoom angle between 330 to 30 and 150 to 210 (I wrote the angles in degrees rather than radians for an ease in understanding). The red areas in Figure 1 are where the particles shouldn’t shoot out and the blue is where they should. I have not been able to achieve the desired effect however. I was wondering if anyone could assist with a link to helpful reading or an example in code. I have been searching google but cannot find a decent example.
Figure 1
Notes:
-
– The angles are written in degrees but will need to be changed to radians because Flash uses radians, a simple conversion (
Math.pi/180) added to the code should suffice.– Figure 1 resembles the Cartesian Coordinate system but the y axis is inverted in Flash’s coordinate system.
– I would post the code that I have tried but it is so far from what is desired that it would not help.

1 Answer