When the object is rotating, the pixels themselves aren't rotating around their center, they're just rotating around another fixed point. So with that effect, there are pixel sized gaps evenly spread throughout the object. I think this happens in order to preserve the actual shape of the object.

So the way I render images onto the screen involves having an array of color data from a buffered image. I can manipulate that one image, through the color data, and basically render any other image into that main buffered image. The problem I'm having right now is I'm having trouble implementing a rotation transformation correctly on this array. I've gotten strange results, where the sprite is rotating around the origin (top left corner). I couldn't really figure out how to make it rotate around it's center or any point. Also with that rotation, there are tiny gaps in the sprite while it's rotating.

So I've experimented in different implementations of getting input from the user. This current implementation allows me to poll for constant input and also achieve a psuedo event system with the isClicked method. Also, with the addition of a hash map, I can check for any java KeyEvent or MouseEvent very quickly. Is there anything else that can be improved? I've been through many implementations, adding on what I learn over time, and I'll be glad to take any advice.

It may be a different way of rendering, but I don't think there would be any benefit, and in fact may be detrimental. It's a lot quicker to assign a color value to an array element (if pixel level manipulation is required) than to assign multiple values to a rectangle object. There are other reasons to avoid this approach, but in the end, you want to work with the API, not against, or around it.

As BurntPizza said, if performance is your top concern, consider a different API than Java2D. Personally, I haven't hit the wall with Java2D yet. I get around 1200+ FPS on a fairly modern machine at 1024x768 resolution with every pixel being touched during my rendering loop. Even my craptastic 7 year old laptop with integrated Intel video still manages to crank out 120 FPS in the same scenario. The only sure way to know is to try out a few different approaches, and see what works best for you.

Do you mind sharing your approach, it would be greatly appreciated. I've hit a huge wall and I'm sure there's something else I could do without having to move onto other API's. I would love to get that kind of performance at that resolution, but as soon as I start rendering a couple hundred images, the FPS starts sinking dramatically.

I was wondering if I could obtain a buffered image and create another "psuedo" image from that by using the first image's color data to construct an image made up of 1 x 1 rectangles, representing the pixels of the buffered image. I'm not too sure if it would be faster than to use just regular buffered images. I figured it would be a different way of rendering and maybe get some performance gains.

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