title: How to make the background move in a platform game?
body: <p>I am making a simple platform game in Java Swing. Naturally I want some platforms to be too large for 1 screen and I have the following question: what is the best way to make the background move when the character controlled by the player approaches the edge of the screen? In fact not just the background but the whole game content (opponents, bricks etc.)? Surely there must be a better way than just uploading a new image and repainting everything whenever the character moves by 1 pixel. I hope i worded this in an understandable way, I tried to look it up on this site and others but no luck so far. Thx in advance.</p>