0

I searched and was unable to find an answer to my problem. I am creating a breakout game in Java. Every time I run the applet, it flickers. It didn't used to flicker, and I don't remember the exact step where I made it flicker.

Here is my code: http://pastebin.com/7jCgKdZp

I am already using double buffered graphics for everything, and I though that this was supposed to alleviate this flickering problem. Am I just doing too much per frame? Would playing with the timer to make the framerate lower solve this problem?

Many thanks.

Brandon Slaght
  • 1,025
  • 1
  • 12
  • 34
  • *"Would playing with the timer to make the framerate lower solve this problem?"* What happened when you took 60 seconds to try that? For better help sooner, post an [SSCCE](http://sscce.org/). BTW - not many people will follow external links. I did, out of curiosity. The 138 LOC shown will not compile without other classes being present. So, definitely, post an SSCCE. – Andrew Thompson Nov 27 '13 at 09:53
  • 1) Why code an applet? If it is due to spec. by teacher, please refer them to [Why CS teachers should stop teaching Java applets](http://programmers.blogoverflow.com/2013/05/why-cs-teachers-should-stop-teaching-java-applets/). 2) Why AWT rather than Swing? See this answer on [Swing extras over AWT](http://stackoverflow.com/a/6255978/418556) for many good reasons to abandon using AWT components. If you need to support older AWT based APIs, see [Mixing Heavyweight and Lightweight Components](http://www.oracle.com/technetwork/articles/java/mixing-components-433992.html). – Andrew Thompson Nov 27 '13 at 09:57
  • Well increasing the timer makes the game slower and flicker less often, but I don't think it makes the flickering any less frequent, ie it flickers over the same number of frames on average but the frames come slower so it seems like it flickers less – Brandon Slaght Nov 27 '13 at 09:59

0 Answers0