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

Re: [pygame] Working on Retro 80s Game SDK, Looking for general support



While I was at pycon a while back I saw someone make a game with the twisted networked event handler. It was pretty sexy at the time. I would ping over at their mailing list and they could probably help you.

You would probably have to back up a step or to to implement it. but I think it would be worth looking into. Networking would be a lot easier IMHO and animation and physics events would be pretty sweet with it.

It is really easy to implement fire and forget techniques. Example: When ship is hit by my missile fire the exploding animation and sound. Than the handler would handle the rest with out you having to do much. i.e.you don't have to iterate through your sprites every frame to check on their animation and physics states. Saves some speed.

http://twistedmatrix.com/trac/

Cheers,
James Hancock

On Thu, Jan 8, 2009 at 11:40 AM, Casey Duncan <casey@xxxxxxxxxxx> wrote:
Note you can get basically the same functionality using the built-in assert statement and running the program through pdb, as in:

python -m pdb myprogram.py

Nice thing about that is that it drops into the debugger right away so that you can set breakpoints if desired. Plus it will drop into the debugger at any uncaught exception, not just failed asserts.

To run it with asserts turned off, use the -O python cmd line option.

-Casey


On Jan 7, 2009, at 4:51 PM, Jake b wrote:

On Wed, Jan 7, 2009 at 2:00 AM, Patrick Mullen <saluk64007@xxxxxxxxx> wrote:
On Tue, Jan 6, 2009 at 10:59 PM, Jake b <ninmonkeys@xxxxxxxxx> wrote:
through, I use the "assert" statement to make sure that the frame counter is no
longer progressing.  Later, if I change some of the animation code
somewhere that
might mess up the play_3_times behavior, when i run the tests that
test will error,
and I'll know I broke something.

Do you use the assert statement, or do you have a function like this?

def _assert(exp, msg=""):
       """An assert() function.
       source: http://www.gamedev.net/community/forums/topic.asp?topic_id=496793"""
       if __debug__ and not exp:
               import pdb
               print "\n_assert failed:\n\t%s\n" % msg # or: simple: print "_assert failed: ", msg
               pdb.set_trace()

--
Jake