I'm having trouble drawing the right way it seems, it takes about 500-800 milliseconds to complete a single loop in my render method. Any suggestions or links that might explain what to do. Can't find anything on the forum, please help!

well the only thing i can see that would make it slow is the image format. Create your bufferedImage with GraphicsDevice.createCompatableImage();. Any colour space/format conversions fall back to a really slow software renderer.

In fact you should copy all your images onto a compatible image. For example using ImageIO to load a jpg will return a BufferedImage in a YCrCb or whatever colour space in some cases.

I have no special talents. I am only passionately curious.--Albert Einstein

My point wasn't to use ImageIO. But that ImageIO will often use a incompatible image format from the device. So that draw image will result in a colour translation per pixel rather than just a mem copy of the data to the video memory.

I have no special talents. I am only passionately curious.--Albert Einstein

Now I load the image in the constructor, and it got better, down at 200+ milliseconds, but not quite the time i hoped for... Was aiming for 16 milliseconds (to reach 60 fps)... would it help to only load into memory the images that I draw?

Fills a rectangle 800x20 pixel rectangle at (0, 580). This is done ONCE FOR EACH LOOP = 24*42 times * 800*20 pixels. Why are you filling a that big rectangle for each tile AT THE SAME PLACE every loop? My post was supposed to make you notice that.

As others have pointed out:- Try to do as little drawing calls as possible, Java2D is quite slow.- Don't load images in your loop- Try to create as little number of objects in your loop- Find better ways than using lots of for loops

EDIT: I took a good look at your render() method:- I believe theagentd pointed out, don't fillRect 24*24 times! This should only be done once and on the whole image.- Why are you drawing the FPS 24*24 times?! This should also be done once and at the end of your render() method.

As others have pointed out:- Try to do as little drawing calls as possible, Java2D is quite slow.- Don't load images in your loop- Try to create as little number of objects in your loop- Find better ways than using lots of for loops

Thanks again a lot I just found out, that if I don't have any null tiles on my screen it only takes 1-7 milliseconds to draw, so it must be something with the null tiles I draw... Just have to figure out how to solve that problem

Would need to make my player go off center when he reaches the edge of the world.....

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org