I am making a 2d game in Java, and I have some questions abot rendering.
Should I re-draw Objects every Frame althought they are still visible or static? If not how would I detect how an image is not being changed so I would not render it? What things should update everyframe, and what type of images?
Thanks
In most cases, it's always better to render each object uniquely each frame. If you were to try and figure out what has been previously rendered it would usually take more time to compute that and render the new objects than it would to just clear the screen each frame and render each object.
You can think of what you want to do in terms of something like an MP4 file, this file takes each frame of a movie and does not re-render pixels of the same color in the same area. This makes it so the file size is smaller, but if you tried to do this in a game you would essentially be doing something along the lines of an MP4 compression algorithm each frame.
Another problem, if some objects stayed static, and other objects moved around one frame. It is very hard, if not impossible, to clear the screen of only a select few objects.