Hello, I am trying to add some animation to my game to make it a little bit more interesting to look at. I’ve made an animated gif using GIMP, but when I load the image in Eclipse it runs through the animation far faster than it is supposed to. What am I doing wrong?
Here are the relevant bits of code for assigning the image value and drawing the gif.
...
ImageIcon ii = new ImageIcon(this.getClass().getResource(src));
image = ii.getImage();
...
public void draw(Graphics2D g2d, game.Window window){
if(currentHP > 0)
g2d.drawImage(getImage(), x-width/2, y-height/2, window);
}