Closed ex closed 11 years ago
Hi, yes this is a known bug. The problem is that I use this to generate a unique id for missiles: Math.ceil(Math.random()*1000)
This turns out to return the same value from time to time and two sprite are generated with the same ID. This lead to the problem you describe.
The solution is very simple: use a revolving counter instead:
var counter = 0; ... counter = (counter + 1) % maxCounterValue
I will commit this change when I find the time!
I just checked out the master tutorial demo and saw one bullet sprite not being cleared and floating on the game sreen, I saw the same bug in the online demo. Is this a know bug? It seems to happen frequently.