You MUST move the images. You CANNOT move "the screen". The screen is not a camera providing a view into a larger world, it is a collection of pixels a certan width and height fixed in place.
Moving the images in the way I describe will make the screen APPEAR to move. It will be the effect you want.
The screen only APPEARS to be a window into a larger area when you offset the images before you draw them.
So in my example above, add 10 to Screne_X every tiem the user hits right arrow, and that will make the images move to the left... which will make the screen viewport appear to move to the right.
Blitting big images though is not the best way to make a scrolling engine. The best way is to scroll is to use small tiles.
You may be thinking of how one used to scroll graphics in the sayd of DOS. Back then you could make the graphics buffer bigger than the screen, and scroll parts of it into view, then when one whole tile was revealed you could build some more off the edge waiting to scroll onto the screen, and continue to scroll.
But as far as I know, this method of scrolling is no longer possible.
That method isn't that useful anyhow, because noawadays most 2D games have parralax. And the fastest way to do parralax is just to redraw the whole screen every time.
"Another question, if I added a space background and like my spaceship goes right,"
Yes, you can do this. All you need to do is change the spaceship position in the world. So as you are changing screen_X, and subtracting that from the space ship and background tile positions just before you draw them, you also are adding some value to ship_X so that it is moving to the right faster than the screen is scrolling to the left.
Of course, in MOST shooters, they are not realistic, so if you move the ship to the right, it stays there even though the screen scrolls. In that case, you simply position the ship in screen space, and don't subtract screen_X, Screen_Y from it's location every frame. Then it'll stay at Ship_X, Ship_Y on the screen where you left it.
Moving the images in the way I describe will make the screen APPEAR to move. It will be the effect you want.
The screen only APPEARS to be a window into a larger area when you offset the images before you draw them.
So in my example above, add 10 to Screne_X every tiem the user hits right arrow, and that will make the images move to the left... which will make the screen viewport appear to move to the right.
Blitting big images though is not the best way to make a scrolling engine. The best way is to scroll is to use small tiles.
You may be thinking of how one used to scroll graphics in the sayd of DOS. Back then you could make the graphics buffer bigger than the screen, and scroll parts of it into view, then when one whole tile was revealed you could build some more off the edge waiting to scroll onto the screen, and continue to scroll.
But as far as I know, this method of scrolling is no longer possible.
That method isn't that useful anyhow, because noawadays most 2D games have parralax. And the fastest way to do parralax is just to redraw the whole screen every time.
"Another question, if I added a space background and like my spaceship goes right,"
Yes, you can do this. All you need to do is change the spaceship position in the world. So as you are changing screen_X, and subtracting that from the space ship and background tile positions just before you draw them, you also are adding some value to ship_X so that it is moving to the right faster than the screen is scrolling to the left.
Of course, in MOST shooters, they are not realistic, so if you move the ship to the right, it stays there even though the screen scrolls. In that case, you simply position the ship in screen space, and don't subtract screen_X, Screen_Y from it's location every frame. Then it'll stay at Ship_X, Ship_Y on the screen where you left it.