[pygame] wxPython and cleaning up pygame threads

2009-12-18 Thread Mark Reed
Hey guys, I'm running a pygame thread in my wxPython app. If I try to run the pygame thread a second time I get an error when I try to font.render - "Text has zero width" ... A search tells me that this can happen since font.render is not thread safe, but I've killed the previous thread. If I don'

[pygame] "Text has zero width" Exception in font_render

2009-12-22 Thread Mark Reed
I'm running pygame in a thread, killing the thread and reloading it. Second time in we throw an exception with font.render. I have no experience with C, but I would like to debug the problem which appears to be in font_render since both times the python pygame.font.render arguments are the same. I

Re: [pygame] "Text has zero width" Exception in font_render

2009-12-23 Thread Mark Reed
pygame and possibly without a separate thread even. > b) treat this as a pygame bug - i.e. try to make a minimal sample that > demonstrates the problem for somebody (possibly even you) to use for > debugging. > > > On Tue, Dec 22, 2009 at 4:20 PM, Mark Reed wrote: >> >> Sh

[pygame] pygame.mixer.Sound doesn't throw file not found

2009-12-24 Thread Mark Reed
Been using pygame for 5 years and just noticed that pygame.mixer.Sound doesn't throw anything on file not found. I'm guessing either it should or we should update the example .py's to test for it. It took quite awhile to debug this since you assume it would throw if it couldn't load the sound from

Re: [pygame] Erratic behavior with pygame.font.SysFont

2009-12-29 Thread Mark Reed
On XP with 1.9.1 I freeze up on the ~10th font called impact. Fresh Ubuntu install clicks through all fonts without freezing. On Wed, Dec 30, 2009 at 2:28 PM, Daniel Waltrip wrote: > The problem I am having initially arose when I was writing a simple > pygame script that would allow me to 'click

Re: [pygame] AI Module

2010-03-29 Thread Mark Reed
I suggest getting in touch with people who work with game AI. For example jdog500 is modifying the AI for the game Civilization 4 and possibly is using python for some of it, you can contact him on the forum: http://forums.civfanatics.com/forumdisplay.php?f=245 He has worked a lot on optimizing t

[pygame] Game engine?

2010-04-15 Thread Mark Reed
Hey guys, I'm looking for something perhaps where you can specify a gamefield like: """ 0 01110 01010 01110 0 """ Which could be the basis for a variety of games like checkers,chess to loderunner to pacman/wizard of wor. Basically handles single screen games: Tile images Movement between

Re: [pygame] Game engine?

2010-04-16 Thread Mark Reed
A tile engine where all sprites fit into a tile should be fairly simple. Just has to return whether or not movement into tile X from tile Y is allowed and draw all the background tile images.. Having that base would make each game get done much faster. Being not pygame specific I could draw the gam

Re: [pygame] Game engine?

2010-04-16 Thread Mark Reed
b.com/Games/PyBTS/file/f7473ac7857e/src/pybts/terrain > > See tileengine.py and tilemap.py > > -- > Thadeus > > > > > > On Fri, Apr 16, 2010 at 2:29 PM, Mark Reed wrote: >> A tile engine where all sprites fit into a tile should be fairly >> simple. Just

Re: [pygame] Game engine?

2010-04-16 Thread Mark Reed
; > > > > > On Fri, Apr 16, 2010 at 4:13 PM, Mark Reed wrote: >> d eventually I should get to more complicated games which >> would make more use of PyBTS so at that time I'd be able to wo >

Re: [pygame] Layout module for Pygame surfaces

2010-05-15 Thread Mark Reed
Why does it need to be XML? Write it out as python dict's and eval the file. 2 lines of code. And use an existing library and write an editor for it. Thats really the thrust of what you are trying to do. Support the code that is out there instead of rewriting it. Mark On Sat, May 15, 2010 at 5:1

[pygame] pygame music

2010-05-16 Thread Mark Reed
What are the supported file formats for the music module? How big a deal would it be to add seek support or at least rewind( milliseconds ) instead of rewind() which returns to the start? Right now I'm stuck working with wxPython's media module that uses windows media player on windows.. ugh. Ma

Re: [pygame] pygame music

2010-05-17 Thread Mark Reed
game uses the SDL_mixer library for music playback. So it all depends on > how SDL_mixer was built and which other libraries are present. The possible > formats are listed in the SDL_mixer documentation here: > http://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer_frame.html > > Le

Re: [pygame] Layout module for Pygame surfaces

2010-05-17 Thread Mark Reed
XML is only to save the programmer effort and was created because so many languages can't process text and do not have good data structures. It is not the best way for a user to hand enter a design for a UI. And in fact in python it makes the programmers job harder because reading the file is easy

Re: [pygame] pygame music

2010-05-24 Thread Mark Reed
ard Lindstrom wrote: >> >> Hi Mark, >> >> I don't see a problem adding the Mix_SetMusicPosition and >> Mix_FadeInMusicPos functions to pygame.mixer.music. As to why they are not >> in Pygame, it's because they were originally not in SDL_mixer either. >&g

Re: [pygame] pygame music

2010-05-25 Thread Mark Reed
maging it all depends on the version of SDL_mixer in use. > > Lenard > > Mark Reed wrote: >> >> I dropped it into my app and it works perfectly with Ubuntu except a >> bit of a performance problem with the way SDL handles mp3 files as >> music.rewind() has to be

[pygame] Ghosting

2010-08-08 Thread Mark Reed
Is there a ghosting problem with laptop screens that isn't there on desktop screens? I just have a laptop available to me right now, and any game I have with moving objects is bothering me with this ghosting effect behind the images.

Re: [pygame] Ghosting

2010-08-09 Thread Mark Reed
9, 2010 at 2:06 PM, Luke Paireepinart wrote: > Lower quality lcds tend to ghost more. Is it an old laptop or like an acer or > something? > > Sent from my iPhone > > On Aug 8, 2010, at 7:49 PM, Mark Reed wrote: > >> Is there a ghosting problem with laptop screens that

[pygame] Keeping a sprite on screen with rect.clamp

2010-08-15 Thread Mark Reed
In my pygame code I am using rect.clamp to keep sprites within a screen or gameboard, where I clamp and if the center was moved I recalculate the sprite's movement like so: ctr = self.rect.center self.rect = self.rect.clamp(self.clamp_rect) if self.rect.center !

[pygame] Re: Keeping a sprite on screen with rect.clamp

2010-08-16 Thread Mark Reed
Anyone have a function for calculating all the points on a line to be used for sprite movement? Mark

Re: [pygame] Re: Keeping a sprite on screen with rect.clamp

2010-08-16 Thread Mark Reed
g 17, 2010 at 9:41 AM, Luke Paireepinart wrote: > Can you be more specific about what you mean? Are you trying to interpolated > points between two endpoints or what? > > Sent from my iPhone > > On Aug 16, 2010, at 8:13 PM, Mark Reed wrote: > >> Anyone have a functio

Re: [pygame] Re: Keeping a sprite on screen with rect.clamp

2010-08-16 Thread Mark Reed
(p, steps = 30): >     t = 1.0 / steps >     points = [p[0].interpolate_to(p[1], t*i) for i in range(0, steps+1)] >     return points > On Mon, Aug 16, 2010 at 10:13 PM, Mark Reed wrote: >> >> I want to calculate a straight path of points between two points and >> each fram

Re: [pygame] Re: Keeping a sprite on screen with rect.clamp

2010-08-16 Thread Mark Reed
>> I want to calculate a straight path of points between two points and >> each frame do: >> >> sprite.x, sprite.y = sprite.path[step] >> step++ >> > If you want to be really really really specific with your sprite's movement, > there are some spline classes you can use to make your sprite be > int

[pygame] Game art / icons

2010-10-31 Thread Mark Reed
Hey guys, I lost my links to free art websites, where do you get your stuff from? I forget the english for it so am having trouble googling (icons?) but I was using a site that was geared towards UI work - buttons / icons for theming your desktop. It had lots of users contributing good stuff. M

[pygame] Problem copying then playing a wav file

2011-05-04 Thread Mark Reed
I'm using the pyaudio example to save a wave file called "temp.wav" http://people.csail.mit.edu/hubert/pyaudio/#docs The following code correctly plays it: def Play(self): if not pygame.mixer.get_init(): pygame.mixer.init() if os.path.exists("temp.wav"):

Re: [pygame] Problem copying then playing a wav file

2011-05-04 Thread Mark Reed
that I needed to do this, but this fixed it. Mark On Thu, May 5, 2011 at 10:06 AM, Greg Ewing wrote: > Mark Reed wrote: > >>        self.snd = pygame.mixer.Sound(dirname+filename) > >                                         > > Are you sure that dirname

[pygame] wxPython and pygame on the latest Mac

2011-06-18 Thread Mark Reed
Anyone have wxPython and pygame running on the latest version of the Mac? Stock 2.6.1 python in 32 bit mode: - defaults write com.apple.versioner.python Prefer-32-Bit -bool yes - installed and can use wxPython - pygame didn't work after installing: pygame-1.9.1release-py2.6-macosx10.5.zip # f

[pygame] Re: wxPython and pygame on the latest Mac

2011-06-18 Thread Mark Reed
I got it working by installing python 2.6 from here: http://www.python.org/download/releases/2.6.6/ As its noted pygame doesn't work with the stock 2.6. Mark On Sat, Jun 18, 2011 at 2:57 PM, Mark Reed wrote: > Anyone have wxPython and pygame running on the latest version of the Mac? &

[pygame] wxPython and pygame - pygame window will not disappear

2008-01-20 Thread Mark Reed
I'm running my pygame game from my wxPython app, ( it pops up a new window instead of using the window specified by SDL_WINDOWID, but thats ok. ) my problem is the window does not destroy itself after all my pygame related objects are deleted and if I try to call pygame.quit() I get this: Fatal Py

Re: [pygame] wxPython and pygame - pygame window will not disappear

2008-01-20 Thread Mark Reed
I've attached my template for a new app. Its short. It has a Frame, File->Exit menu and an empty panel. I adapted it from a tutorial so it has comments on whats what. Mark --- Ian Mallett <[EMAIL PROTECTED]> wrote: > I'm afraid I don't know the answer to your question, > Mark. > > However, if

Re: [pygame] wxPython and pygame - pygame window will not disappear

2008-01-20 Thread Mark Reed
I assume we are in C code which is why pythons debugger is of no use. Mark --- René Dudfield <[EMAIL PROTECTED]> wrote: > it's not really supported. > > See http://pygame.org/wiki/gui > > > > On Jan 20, 2008 7:24 PM, Mark Reed > <[EMAIL PROTECTED]> wr

Re: [pygame] wxPython and pygame - pygame window will not disappear

2008-01-20 Thread Mark Reed
> Cool! Is there a way to do it without classes and > in a pygame window? > Ian, see from Rene's note: http://pygame.org/wiki/gui Using wxPython with Pygame doesn't mean you can put GUI items inside your pygame window, and right now pygame pops up its own window anyway when called from wxpytho

Re: [pygame] wxPython and pygame - pygame window will not disappear

2008-01-21 Thread Mark Reed
No one has a tip on how to debug a pygame seg fault on XP? I'm sure they come up in many other cases. It actually only took me 2 hours to combine 4 existing complex pygames with my existing wxpython app. And they all work flawlessly (mouse,keyboard,display) except that the pygame doesn't clean its