I am creating a game of Racing cars in java
But the problem is that my car when moved in any direction makes flickering on the screen.
As the project is a Core java project it can only be made in a Windows application form.
I set the speed of my car movement to 20px/keypress to 1px/keypress but the problem that still occur is flickering in the screen.
How can I solve this????
I have attached the files in zip.
Please help me
You are forcing a repaint of the whole applet every time, which may be the cause of your flickering.
In any case it's much better to put your animation in a JPanel, and override paintComponent for the JPanel to do your drawing. Add that JPanel to your applet and don't mess with the applet painting at all (at line 62 just call repaint() on yur JPanel).
ps Sorry, the .java was there and I was being stupid.