So I'm writing a turn based game that involves scrolling a map made of squares which light up as you mouse over them. Everything is drawn on a frame with a 2 buffer strategy. The rendering is done in a separate
thread that loops continuously. When I sleep the render thread for a few milliseconds after each frame to push the fps down to around 30, the squares light up very responsively but the scrolling map jitters pretty bad. If I don't sleep the thread, it sits at around 60 fps and the map scrolls really smoothly, but there is noticeable delay between the mouse passing over a square and it lighting up. The code for identifying which square to light is very simple and quick and the processor doesn't seem taxed, so I don't think that the render thread is slowing things down too much. I'm a little stumped as to what is causing the delay, maybe the mouseEvents aren't spawning fast enough? Any ideas would be greatly appreciated as I'm pretty stumped.