This piece of code is driving me nuts! I know it's probably simple but...:
private void createShots()
{
shots=new Shot[NO_POOLED_SHOTS];
for (int i=0; i<NO_POOLED_SHOTS; i++)
{
shots[i]=new Shot(rctGame);
actorList.addSprite(shots[i]);
}
}
|
The line
actorList.addSprite(shots[i])
|
throws a nullpointerexception at me (at the first iteration of the loop), and I can't figure out why. I have traced through it with a debugger, and I know shots[0] isn't null when I reach that line.
Any thoughts?
Edited by - Eraserhead on January 17, 2001 12:14:19 PM