[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Scrolling background



All right, that's pretty much what I'm doing. Thank you!

On 7/30/11 12:56 PM, NBarnes wrote:
Samuel Mankins<waterflight@xxxxxxxxxxxxx>  wrote:


Forgive me if this is a trivial question.
What is the nicest way to go about having a background which moves at a
constant speed in one direction (as in a side-scrolling shooter)? Right now,
I draw all the sprites onto the background image, which is moving, and then
draw that onto the screen, but is there a neater way?
You have a background that you want to scroll, so it's bigger than the
screen, right?  However it pleases you to do so, determine which
subsection of the background you want to display that frame, then draw
that onto the screen, then draw the sprites on top of that.