Been trying to figure this out for a couple of weeks now.
The player (ball) rolls around on disks and destroys stars, getting points for each star. After a certain number of stars have been destroyed, an achievement is triggered and a set number of power-ups (shields) are awarded.
Right now, i'm testing with the shields being awarded after the 5th, 10th and 15th stars are destroyed.
The problem: if the player falls off a disk and has only destroyed 4 stars, the next time the layout starts, since the disks are created at random positions with the stars pinned to them, the ball can and most of the time will spawn on top of 2 or more disks directly overlapping each other. This destroys 2 or more stars within 0.01 secs. In doing this, the number of stars jumps from 4 (the number before the player died) to 6 or more, and the shields are not awarded and they do not spawn. This can also happen with the 10th and 15th achievement trigger.
I don't know why, since the system has to count the 5th star to get to the 6th. If the player does not die, and scores the 4th, 5th and 6th stars, the shields are awarded and spawned as they should be.
If anyone can take a look and see what i'm doing wrong, or suggest a workaround, it would be more than greatly appreciated.