flickering image
when using an applet to display my game i have the paint() method first draw the backround and then all of the other objects the belong on the screen. when the game moves a little faster the objects flicker over the backround. is this normal?
if its not normal... then can somone please test this example that i put together(in not sure if posting external links to other sites or to files is against any rules but i can assure anyone that i made this):
http://www.esnips.com/doc/5087f156-8242-4ccf-897c-44091124f93e/ThreeD.rar
to make the picture update, use any of the arrow keys, W, A, S, D or the mouse/
[632 byte] By [
sosleepya] at [2007-10-2 22:12:57]

the best solution I can come up with *though I actually havn't gone so far as to check to see if this works well, since I havn't worked with java long enough to get to the point where I'd need to know this* is to paint everything to a panel(s) that aren't on any frame, then save that as a picture and post it on the panel that IS on the frame that you want to update. Then, just erase the empty panel
if that dosn't work, then just trade off frames, instead of coppying *i.e. panel one is painted, then put on the frame, while panel 2 is taken off, panted on, then put on the frame, while panel one is taken off the frame*
I wouldn't actually know the code to do this, but to my knowledge with other various languages, thats how you create a non-flickering game.
sorry for not being able to give you an actual solution using code, hope that helped though
There is a concept in game development called double buffering, which its purpose is to prevent flickering. This concept involves, as decribed above, rendering/painting the graphics off-screen, then transfering the image to the display.
In Java, you would want perform your paining on a component that is not visible (easiest way to do this is to create a component and not add it to the frame), then transfer the image to the visible component.
I checked your program, and it appears as if the image flickers only when it's past a certain size. This means the display is refreshing while the image is being repainted.
Like the other two people said, you need double buffering, where you have two image buffers, so you display the first buffer while updating the second one, then you display the second one while updating the first one, and so forth.