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

Re: [pygame] Problems with keys



Great, thanks alot! Now it works beautifully.

Now eventually you will probably want to wrap the goRight and goLeft
into members of a game character class, or have a "velocity" member, or
something more object-oriented than this example, but as far as the
keyboard handling goes, I think this is what you want.

(and don't forget to use os.path.join() for your directory names!)

---
James Paige

Yes, actually I'm working on a 2d game engine which I'm trying to make as much object-oriented as possible. I just put this problem into a simple test program to keep the amount of code small.


Thanks again.
Juha Salo