I've been working on a game in Java, and recently I decided to try out my game on a netbook just to see how it would run. While I do get a constant and decent FPS, it appears that my lighting rendering decides to freak out a bit. This only happens on the netbook, however, and I'm not sure how I can fix it.
Here's the lighting glitch:
I'm doing my lighting simply by drawing black rectangles with certain alpha values over each tile.
As you can see, for some reason there are sometimes vertical and (although not shown) horizontal lines that the alpha rectangles apparently aren't drawing over.
The lines flicker on and off as I move around, and placing two blocks on top of each other prevents the glitch for those blocks.
I'm using Graphics to draw on a JFrame, and the block rendering code looks like this:
g.drawImage(sprite, (int)x, (int)y, null); g.setColor(new Color(0,0,0,<insert darkness level>)); g.fillRect((int)x,(int)y,32,32);
Someone on another forum thought it could be rounding errors with the block positions, but all the blocks are snapped to a 32x32 grid on creation.
I'm not sure there's anything wrong with the code itself, which is why I'm not sure how to fix this. If someone could help, I'd be really, really grateful, because I'm truly stuck here. Thank you in advance!