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

Re: [pygame] Pygame.init In Multiple Files -- Solved, Sort Of



Massive lines like these were the culprits when I got
a similar problem. Something - dunno if it's Python,
pygame, or SDL - breaks when you try to complete a
string and load an image from it and convert it at the
same time. Break them up and it will probably work.

Thanks, but I may have solved the problem. GENERIC_OBJECT_IMAGE (etc.) was a constant, and I was trying to change the value of that constant so that it'd hold a Surface instead of the original string. Python didn't seem to like that. Instead I made GENERIC_OBJECT_IMAGE_FILENAME to hold the string, then loaded the image into GENERIC_OBJECT_IMAGE, and the program then behaved. In that respect. So far.


In general, Pygame gets confusing when you want to have multiple included modules drawing to the same screen Surface.

The thing I'm working on, I'm showing off here: <http://www.livejournal.com/users/niss_the_ai/>
I hope to post some simple Python demos to the PCR too.


Kris
Appeaser of snakes