Alguem pode me ajudar, estou recebendo a msg ai na execução do metodo abaixo
Exception in thread “Thread-3” java.lang.NullPointerException
at Asteroids.updateBullets(Asteroids.java:251)
at Asteroids.gameUpdate(Asteroids.java:214)
at Asteroids.run(Asteroids.java:188)
at java.lang.Thread.run(Thread.java:722)
/*************************************************************************
* update the bullets based on velocity
************************************************************************/
public void updateBullets() {
//move each of the bullets
for (int n = 0; n < BULLETS; n++) {
//is this bullet being used?
if (bullet[n].isAlive()) {
//update bullet's X position
bullet[n].incX(bullet[n].getVelX());
//bullet disappears at left/right edge
if (bullet[n].getX() < 0 ||
bullet[n].getX() > getSize().width)
{
bullet[n].setAlive(false);
}
//update bullet's Y position
bullet[n].incY(bullet[n].getVelY());
//bullet disappears at top/bottom edge
if (bullet[n].getY() < 0 ||
bullet[n].getY() > getSize().height)
{
bullet[n].setAlive(false);
}
}
}
}