Array with multiple Objects with expire-timers fails
I am making a game in HTML5, and now I just got a disturbing problem. In my game I have an Array with all the particles, all the particles have expire-timers, with different random generated delays. When the expire-timers expire they delete there own Object with the Array.splice() function, that causes trouble, since the Array.splice() function will mess up the order of the Array. First I had the function like this: (n = Blood particles to spawn, and x and y = starting point.) (All particles is spread random directions from the middle, and then they are decelerated by friction) function