1 decade ago by DaveVoyles
I know, I know, there have been 100 threads in here about scrolling backgrounds. I've looked through each one of them, several times, and even opened the code behind Xtype just to get an idea of how he does it there.
Despite all of this, I can't manage to create a scrolling background. Essentially, I'm creating a side scolling 2D space shooter. As it stands, I have my ship constantly moving from left to right (positive on X) and the screen/camera follow the ship, and the backgrounds are stationary, and created with Weltmeister (love this tool).
Ideally, I'd like to have my backgrounds scrolling from right to left (negative on X), and have my ship only maneuver within the borders of the screen.
Is it possible to have a combination of both? My ship moving AND the background moving? Even if I have a single .png as a background, that's fine!
I've attached a link to the code in my game class. How would you proceed from here? I can draw a static image for a background, but for the life of me I can't get it to scroll.
http://pastebin.com/4ptRYt4W
Despite all of this, I can't manage to create a scrolling background. Essentially, I'm creating a side scolling 2D space shooter. As it stands, I have my ship constantly moving from left to right (positive on X) and the screen/camera follow the ship, and the backgrounds are stationary, and created with Weltmeister (love this tool).
Ideally, I'd like to have my backgrounds scrolling from right to left (negative on X), and have my ship only maneuver within the borders of the screen.
Is it possible to have a combination of both? My ship moving AND the background moving? Even if I have a single .png as a background, that's fine!
I've attached a link to the code in my game class. How would you proceed from here? I can draw a static image for a background, but for the life of me I can't get it to scroll.
http://pastebin.com/4ptRYt4W