I am making a game in java. I started with code for space invaders game, and am significantly altering it.
One of those changes involves me making it so that the map is adding zoom and scroll functionality, and then making the world much bigger than will fit on a single screen at normal zoom.
I had planned to achieve zoom by creating a parameter called zoomFactor, which can increase or decrease with user input (scroll wheel?). I would then put that in pretty much every command related to drawing my objects or moving them.
such as xPosition += xVelocity*zoomFactor;
The above should make objects appear to move faster when zoomed in.
I would then have to have code that also moves objects when the zoom factor changes, which would be very easy, but would get a bit more complex when I add the ability to scroll as well.
As for scrolling, I would simply have scrolling right be accomplished by moving all objects left by the amount I want to scroll.
I figured I would ask for some advice first - can anyone think of easier ways to accomplish this?
Many thanks for your time