A static animation system
I am trying to make an static animation system, for my game, just a basic sys开发者_开发百科tem that switches pictures after an amount of miliseconds. I want my character to do some basic walking, and some basic animations based by an amount of pictures. Like, it plays all the images in a row, in a certain speed, so it does an animation, how would I go by making this in Java? Would be nice if someone explained how I do this, because I need it.
Read through the How to Use Swing Timers tutorial. Animation is not that complicated to get something simple working - multiple times a second you change the position of an image, or switch one image for another, or somehow manipulate the displayed image.
It sounds like you're trying to incorporate this into a game environment, but your question doesn't make sense to me - are you dealing with sprites? If so you should read this tutorial on Sprite Animation in Java.
精彩评论