I have some general questions about the bufferedstrategy class and how I can use them and hope you can help.
a) Since I use the graphicscontext (graphics2d g) to draw, do I have to clear the screen for every iteration of my gameloop to avoid duplicates? If I have a map with a box, if I don’t clear it and the box moves during one iteration, will I draw two boxes or is the image automatically cleared for me?
b) Depending on the above, if the image is automatically cleared, do I have to redraw EVERYTHING in every iteration of the gameloop? This seems a bit inefficient (imagine the player going afk for 30 minutes, I am still rendering at full speed, the same static objects).
c) I am currently attaching a bufferedstrategy to a canvas, this canvas can have a gazillion subcomponents. Do I have to render each and every component (how?) or does the canvas have a paint-method that paints all of its components? How would one actively render a components image?