Help With Double Buffering/Animations
I have turned my interests towards expanding my Java knowledge of game animating and logic. There is one problem however...
I don't know how to use Double Buffering (and the internet has not been too useful) nor the best way to go about animating graphics.
The only animating I have done thus far is using different frames and a Thread.sleep(x) call. However, that is certainly not adequate for a game where the player is controlling how the graphical environment behaves.
So for starters...
1. Can anyone elaborate the "Double Buffering" method for me? It seems logically important in creating smooth animations without the flashes.
2. Share your favorite method of animation if you have experience in that area.
Re: Help With Double Buffering/Animations
Swing automatically enables double-buffering - see Double Buffering Support. If you use the framework correctly, you shouldn't have problems with flashing.
If you want full control over screen painting for performance, you could try active rendering (although this requires full-screen exclusive mode). See Passive vs Active Rendering.