How to offset particles from point of origin
Posted
by
Sun
on Game Development
See other posts from Game Development
or by Sun
Published on 2012-09-09T23:19:36Z
Indexed on
2012/09/10
3:49 UTC
Read the original article
Hit count: 209
Hi I'm having troubles off setting particles from a point of origin. I want my particles to spread out after a certain radius from a the point of origin. For example, this is what I have right now:
All particles emitted from a point of origin. What I want is this:
Particles are offset from the point of origin by some amount, i.e after the circle. What is the best way to achieve this? At the moment, I have the point of origin, the position of each particle and its rotation angle. Sorry for the poor illustrations.
Edit: I was mistaken, when a particle is created, I have only the point of origin. When the particle is created I am able to calculate the rotation of the particle in the update method after it has moved to a new location using atan2() method.
This is how I create/manage particles: Created new particle at enemy ship death location, for every new particle which is added to the list, call Update and Draw to update its position, calculate new angle and draw it.
© Game Development or respective owner