Hey, im making a SpaceShooter game and I am using 2 arrays to hold enemys and lasers so that I can use for…in loops to detect collision and such. I have a function that spawns the enemy or laser and puts them into the array[aray.length], but when i have them destroyed I realized I can’t delete its spot in the array, which ends up slowing down my game after a while. Does anyone know how I can keep this array clean?
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Array Question
|
0 | 79 | February 21, 2005 | |
A couple of problems
|
0 | 71 | December 13, 2007 | |
[AS3] array and splice | 0 | 110 | November 19, 2011 | |
Removing children and Arrays? | 0 | 41 | May 6, 2009 | |
Removing objects from Array | 0 | 67 | November 23, 2009 |