2014-10-22 17:17:38

Hi,
So with all the popularity of python around these boards of late, I checked it out. I tried some getting started with python books, didn't work really. Guess I learn better from the reference manuals for some reason. Lol. Anyway, so I was wondering..what do I need to make an audiogame? I got pyglet, but i've heard pyglet doesn't have much of a comunity really, so I could be stranded on questions. Also, someone recommended box2d, which is a physics library from what I can gather. It will probably help me out in 2d games, but for a side scroller i'm unsure if I need it. Any thoughts? should I use pyglet? pygame?

This is not a signature.

2014-10-22 18:23:17

Looking at the docs, Pyglet has much, much easier audio.  Pyglet may have harder input, but the actual capabilities it gives you vs. creating your own look much more advanced.  Pyglet would have saved me about a week of work when I did i3d (I need to do something with i3d besides let it languish on my hard drive...).  Pygame will work just as well, but there's tradeoffs.  In the case of Pyglet's community I can't comment, save this: even a library with a "small" community will likely be a much larger community than the entirety of this forum.
As for Box2d, you probably don't want it yet.  I have considered using it for a side scroller, but there would be issues; in that case, a 2d array is probably what you want.  For the case of a first-person game, Box2d is exactly the thing for the project.  There's also ODE, but ODE is more complicated and you don't get too much extra from it.
As for 2D arrays in Python, consider looking at dictionaries wherein the keys are tuples (x, y) and the values are tile instances.  For extra bonus points, see collections.defaultdict which would let you set the "default" tile--say, the instant death square--for when the levels' boundaries are exceeded.  Also keep in mind that for x in y tests sets and dicts are O(1) versus O(n) for lists and other list-like things (i.e. a list takes 5 million operations for 5 million items, a dict or a set takes something very, very close to one.  How to read big o notation is way beyond what we want to go into here, but you should at least be familiar with it).
See also: pickle, sqlalchemy (advanced pickling, has some advantages), requests (connect to HTTp servers, i.e. twitter-but Twitter has dedicated packages), py2exe (obvious),, numpy (not so much for games, but very very useful for doing stuff with big arrays of numbers).
And the advanced ones: Twisted (networking, good for games, screws with your head at first but better than gevent and other "green" threads libraries), django (build http web servers, if nothing else good for auto-updating), gameobjects (contains a lot of 3D math stuff which is fun to experiment with), Pyode (ODE bindings to Python), setuptools (making your own python packages)
And the essential package: accessible_output2.  Note that accessible_output is not maintained.
And the place to get tons and tons of pre-built packages for windows (bookmark this, really): http://www.lfd.uci.edu/~gohlke/pythonlibs/
Finally, you will want to Google and install pip.  Python 3 now comes with it, and I believe Python 2.7.8 also does.  It's what everyone's moved to-with pip installed, many, many packages are just pip install foobar.  You may also need this download from Microsoft in the near future.

My Blog
Twitter: @ajhicks1992