I am making a Pokemon Style 2D java game using no libraries, just pure java, and I am working on and having issues getting a water tile to animate. I want the tile to update every half a second or so. I will post my main class, abstract tile class, water class, and screen class so that maybe you can figure out a way to so me how to animate tiles in my game.
P.S: Right now I am trying to animate a water tile. And all the sprites are for testing and will be changed later.
Code at DropBox: AnimatedTile
, Main
, Screen
, Tile
.
I posted my animation tutorial in other animation question although doesn't seem the other guy liked it so much. Maybe you'll find it more useful, I used java.awt only. Has a working example on how to animate images. In my method - all of the tiles for the image to be animated are contained in one long image, and by updating the X coordinate of the part of buffer to be loaded it is possible to scroll through the frames and achieve animation that way.
Enjoy: https://sites.google.com/site/javagamescorner/home/animated-sprites