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

Re: [pygame] Making a character move?



On Sun, 2005-10-02 at 16:19 -0700, Peter Shinners wrote:
> On Sun, 2005-10-02 at 14:30 -0600, Joseph Quigley wrote:
> > I can't figure out how to move an image to the left when the Left arrow 
> > key is pressed. I've looked at
>
> As for starting with left and right, you should look at the "chimp" and
> "aliens" example. 

Ok, figured I might as well throw out a few more details. The only way
to get your object to face both directions is to make two images that
face both directions. 

In both these example programs, you'll see we mirror the character image
with "pygame.transform.flip(surface, True, False)". Then every time the
character is drawn, it picks either the left image or the right image.