Dear everybody,
my code generates NullPointerException after I change the sprite into array, the code is shown below:
private Sprite[] c2;
public GameScreen() {
for (int i=0; i<51; i++) {
Random rand = new Random();
n = Math.abs(rand.nextInt()%52);
coordX = coordX+1;
Graphics g = getGraphics();
render(g);
c2[i] = createCard("/LONGMinicardfull.png");
lm.append(c2[i]);
}
}
The code were built without any error, but it has some exception after I run the program
Thank you very much