Re: [pygame] my rpg game (so far)
On Tue, Nov 4, 2008 at 11:58 PM, Michael Fiano [EMAIL PROTECTED] wrote: On Sat, 1 Nov 2008 05:06:08 -0400 Michael Fiano [EMAIL PROTECTED] wrote: I am stuck. I realized I need to blit the player the the map surface instead of the screen so that I can position the player at a given map position. The problem is if i change line 66 of player.py from: self.screen.blit(self.playerimgs[self.frame], (self.x,self.y)) to: self.background.blit(self.playerimgs[self.frame], (self.x,self.y)) The map (also on the background surface) does not get repainted properly. The player leaves trails when he moves. I'm not sure how to fix this, or why it even occurs. Somebody enlighten me? No need to place him on the map itself, as long as you position the player so that he is aligned with the background. I assume you are doing scrolling? If you are scrolling by moving, the background, blit the player this way: self.screen.blit(self.playerimgs[self.frame], (self.x+backgroundx,self.y+backgroundy)) Your way would work if you create a new copy each time: this_frame_bg = self.background.copy() this_frame_bg.blit(self.playerimgs[self.frame], (self.x,self.y)) But it is probably slower to copy a whole surface like this.
Re: [pygame] my rpg game (so far)
are you calling pygame.display.flip() with arguments? Sounds like you might not be updating the screen. -- Jake
Re: [pygame] Linux binaries
Hi guys! I agree, just wanted to add that many iterations over trivial code benefits (speed-wise) tremendously from being written in C and accessed in Python, or at least that is my experience. :) Guess you have to weigh it against the added complexity of having to compile C code, maybe for mulitple platforms, etc. On 2008-11-05 (Wed) 13:57, Greg Ewing wrote: Patrick Mullen wrote: On Tue, Nov 4, 2008 at 12:55 AM, Greg Ewing [EMAIL PROTECTED] wrote: The only way to improve speed is to re-code the cpu-intensive parts using something more efficent, such as C or Pyrex. Or, of course, write better python code if possible in those parts. Yes, certainly -- finding a better algorithm is always the best form of optimization! -- Greg
Re: [pygame] Linux binaries
yeah, best to use both! Use each tool where it is best at - and get best of both worlds! cu, On Thu, Nov 6, 2008 at 12:53 AM, Peter Gebauer [EMAIL PROTECTED] wrote: Hi guys! I agree, just wanted to add that many iterations over trivial code benefits (speed-wise) tremendously from being written in C and accessed in Python, or at least that is my experience. :) Guess you have to weigh it against the added complexity of having to compile C code, maybe for mulitple platforms, etc. On 2008-11-05 (Wed) 13:57, Greg Ewing wrote: Patrick Mullen wrote: On Tue, Nov 4, 2008 at 12:55 AM, Greg Ewing [EMAIL PROTECTED] wrote: The only way to improve speed is to re-code the cpu-intensive parts using something more efficent, such as C or Pyrex. Or, of course, write better python code if possible in those parts. Yes, certainly -- finding a better algorithm is always the best form of optimization! -- Greg
Re: [pygame] Linux binaries
i agree, does the wrapper have a name, or is it on the python/pygame sites On Wed, Nov 5, 2008 at 8:13 AM, René Dudfield [EMAIL PROTECTED] wrote: yeah, best to use both! Use each tool where it is best at - and get best of both worlds! cu, On Thu, Nov 6, 2008 at 12:53 AM, Peter Gebauer [EMAIL PROTECTED] wrote: Hi guys! I agree, just wanted to add that many iterations over trivial code benefits (speed-wise) tremendously from being written in C and accessed in Python, or at least that is my experience. :) Guess you have to weigh it against the added complexity of having to compile C code, maybe for mulitple platforms, etc. On 2008-11-05 (Wed) 13:57, Greg Ewing wrote: Patrick Mullen wrote: On Tue, Nov 4, 2008 at 12:55 AM, Greg Ewing [EMAIL PROTECTED] wrote: The only way to improve speed is to re-code the cpu-intensive parts using something more efficent, such as C or Pyrex. Or, of course, write better python code if possible in those parts. Yes, certainly -- finding a better algorithm is always the best form of optimization! -- Greg
Re: [pygame] Linux binaries
nvm i just got to see which one wil be the best for what im doing On Wed, Nov 5, 2008 at 8:29 AM, Matt Pearson [EMAIL PROTECTED] wrote: i agree, does the wrapper have a name, or is it on the python/pygame sites On Wed, Nov 5, 2008 at 8:13 AM, René Dudfield [EMAIL PROTECTED] wrote: yeah, best to use both! Use each tool where it is best at - and get best of both worlds! cu, On Thu, Nov 6, 2008 at 12:53 AM, Peter Gebauer [EMAIL PROTECTED] wrote: Hi guys! I agree, just wanted to add that many iterations over trivial code benefits (speed-wise) tremendously from being written in C and accessed in Python, or at least that is my experience. :) Guess you have to weigh it against the added complexity of having to compile C code, maybe for mulitple platforms, etc. On 2008-11-05 (Wed) 13:57, Greg Ewing wrote: Patrick Mullen wrote: On Tue, Nov 4, 2008 at 12:55 AM, Greg Ewing [EMAIL PROTECTED] wrote: The only way to improve speed is to re-code the cpu-intensive parts using something more efficent, such as C or Pyrex. Or, of course, write better python code if possible in those parts. Yes, certainly -- finding a better algorithm is always the best form of optimization! -- Greg
Re: [pygame] Linux binaries
i have been doing C++ for a while now and was wondering if there was a python wrapper for it, if so can i use and compile in visual studio?? On Wed, Nov 5, 2008 at 7:53 AM, Peter Gebauer [EMAIL PROTECTED] wrote: Hi guys! I agree, just wanted to add that many iterations over trivial code benefits (speed-wise) tremendously from being written in C and accessed in Python, or at least that is my experience. :) Guess you have to weigh it against the added complexity of having to compile C code, maybe for mulitple platforms, etc. On 2008-11-05 (Wed) 13:57, Greg Ewing wrote: Patrick Mullen wrote: On Tue, Nov 4, 2008 at 12:55 AM, Greg Ewing [EMAIL PROTECTED] wrote: The only way to improve speed is to re-code the cpu-intensive parts using something more efficent, such as C or Pyrex. Or, of course, write better python code if possible in those parts. Yes, certainly -- finding a better algorithm is always the best form of optimization! -- Greg
Re: [pygame] Linux binaries
Uh. you misunderstood me. I use Linux (Xubuntu), and I am going to release the source code for my game. The only reason I wanted to release a so-called Binary Blob is to give Linux users another option for using the game than installing from source. I also thought that Binary Blobs where faster than Source Blobs. - Original Message - From: bhaaluu [EMAIL PROTECTED] To: pygame-users@seul.org Subject: Re: [pygame] Linux binaries Date: Tue, 4 Nov 2008 23:27:48 -0500 On Mon, Nov 3, 2008 at 5:10 PM, yanom @linuxmail.org [EMAIL PROTECTED] wrote: I understand you can use py2exe to make your python program into a Windows executable, but is there a tool for making them into a Linux binary? I want my game to run faster. Your game will run faster on GNU/Linux anyway. The important thing is to make your source code available, so many eyes can see it. You'll find out soon enough where the knotholes are! Use the Source Luke! Now, if the real reason you want to distribute a Binary Blob to GNU/Linux users is because you want to generate some sort of income, your game probably isn't worth the few cents you want to charge for it. As if! Why do you even think GNU/linux users would want a Binary Blob of your little game on their disk? Think about it! I don't even know what thought process caused you to even ask this question? The best thing about GNU/Linux is the people who USE it! -- b h a a l u u at g m a i l dot c o m Kid on Bus: What are you gonna do today, Napoleon? Napoleon Dynamite: Whatever I feel like I wanna do. Gosh! = Uniforms Browse a huge selection now. Find exactly what you want today. http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=664e80acdb7b3b4b11840ee7539e52c2 -- Powered by Outblaze
Re: [pygame] Linux binaries
Here is a nice bogosort http://www.siafoo.net/algorithm/5 On Thu, Nov 06, 2008 at 08:48:04AM +0800, yanom @linuxmail.org wrote: What's Bogosort? - Original Message - From: Charlie Nolan [EMAIL PROTECTED] To: pygame-users@seul.org Subject: Re: [pygame] Linux binaries Date: Tue, 4 Nov 2008 22:06:39 -0600 Yes, certainly -- finding a better algorithm is always the best form of optimization! Yup. Even a supercomputer is going to choke if you feed it Bogosort. = Local Doors Door Frames Find Local area door door frame dealers at YellowPages. http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=749b3206efcdf5712e92bb91fe34e820 -- Powered by Outblaze
Re: [pygame] Linux binaries
On Nov 5, 2008, at 4:48 PM, yanom @linuxmail.org wrote: What's Bogosort? Back in my day, we didn't have Wikipedia, we had the Jargon file, and we LIKED it. (Note that although if I am really to show my age, I have to decry the Eric Raymond update which, to a large extent, diluted the winnage of the original. But the original does not have an entry for Bogo-Sort, so there you go.) http://catb.org/jargon/html/B/bogo-sort.html It is highly educational and entertaining to read these old repositories of wordplay and politics. For instance, you probably have always frobbed things (it's part of the hacker DNA), but now you can understand the distinction between frobbing, twiddling, and tweaking, and this might actually come in handy at some point. See also the story about Magic in the Appendix.