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

Re: [pygame] Scrolling



oh ya! Rabbyt has a "set_viewpoint()" that does that
thanks for your help everyone


From: James Paige <Bob@xxxxxxxxxxxxxxxxxxx>
To: pygame-users@xxxxxxxx
Sent: Tuesday, August 4, 2009 11:44:21 AM
Subject: Re: [pygame] Scrolling


On Mon, Aug 03, 2009 at 05:58:48PM -0700, Yanom Mobis wrote:
>    so... blit them all to the screen and change their x and y values as you
>    scroll?

If you do that, you have to update the x/y of every single sprite or
tile for every movement.

What I like to do is to make all my sprite position relative to the
whole map.

Then I maintain a "camera" x/y position.

When I blit, I use sprite position minus camera position to get screen
position.

---
James