Hi all, I’m currently working on a particle system for a game that I recently started development on, but I’ve hit a snag:
I have a class particlecontainer that tells each particle what to do on enterframe, and which contains each particle as a child. I also have a class (mischandler) which has a static array that contains all current particles, as well as another static array that is a buffer to remove particles from the particlecontainer. Whenever a particle “dies”, it calls a function which adds it to the buffer array in mischandler. However, when I try to access this buffer array from the particlecontainer class it does not recognize it as having any elements. If this is unclear here’s a simpler explanation:
particlecontainer tells a particle to do it’s enterframe function
particle calls die() and adds itself to the removebuffer inside mischandler
particle container tries to access mischandler.removebuffer but removebuffer has no elements
Strangely, the particle can access the removebuffer perfectly fine and sees all the elements in it. Any suggestions?