Question

I have developed a snake game in Java. The problem is that I see a flicker while the game is running. Can anyone please inform me why this is happening and direct me to a possible solution?

The code for the game can be found here.

Was it helpful?

Solution

Have you considered double buffering?

Looking at your code, what about the following being a potential cause

Thread.sleep(1000)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top