I am working on a 2d game in which sprites for player are stored in array list. Since player has multiple states, I want to remove previous states upon use. I have an ArrayList as:
List<Image> x = new ArrayList();
Not that its JavaFX image.
Now I use images from this list as: someImageView.setImage(x.getImage(y));
And I remove first (say 5: 0,1,2,3,4,5th images) states as:
for(int i = 0; i < 6; i++)
x.remove(y);
But these images still show instead of the next image set. Could it be some sort of Caching? If so how can I delete this cache so my new images are applied?
My sprite images declaration is as follows (shown for one image, but its similar for all images):
Image someImg = new Image("path", true, false, true);
