Elements - 2d Physics For Python


dentrado

Member
Joined
Sep 17, 2008
Messages
143
I just thought I should show this, I haven't looked very carefully but I think it looks really nice, If I understand it correctly it's a physics API for python that can be used with both pygame and pyglet (and cairo) made to be easy to use. It uses Box2D (python bindings here). It is developed in the OLPC project and is used as a backend for their physics activity.

I think this could be cool to use in some future game for pandora (I'll just have to learn to use pygame and program better first :p).
 
There's also pymunk, a Python wrapper for the Chipmunk physics library. I love how easily it integrates with Rabbyt, which is a sprite library. I'm not sure if Rabbyt will work on OpenGL ES, though.
 
I've used pyglet and pymunk, it's just brilliant. Haven't used rabbyt in any significant way since I had the impression its collision detection overlap with pymunk would be bothersome.

I don't think pyglet (or rabbyt for that matter) works with opengl es 1.1 or 2.0 yet and I don't even know of any projects trying to do that.
 
I haven't used either pygame or pyglet (just some very short tutorials) but I'm planning to. I have heard many good things about pyglet so I really hope that it will be ported.

It sounds as if many would prefer pyglet over pygame, but it also seems that it will be harder to get to run on pandora... :unsure:

I found this, the biggest problem with porting pyglet seems to be that ctypes don't exist for ARM. But this seem a bit strange, on one hand there is no arm package for ctypes in debian so this could be true, but on the other hand in python 2.5 ctypes is included, and python 2.5 is running on arm.

Oh, and thanks for the tips about pymunk and rabbyt, I'll have to look closer at them when I have time.

pyglet + rabbyt + pymunk seem like a good combo (the question is, will it be possible to run on pandora someday?)

I've heard both that chipmunk is better than Box2D and the opposite but I think this is the most informative I've read about it, it explains a bit about the different goals of the projects.
 
Oh, man- it will take some serious work to get pyglet or pygame working on the pandora?
I don't know much about anything coding wise, other than python, is ther a possibility that someone could create a library or something to get the python libraries working on the pandora?
 
Yes, pygame will be available. Which is a pity, because pyglet is much nicer.

According to the debian sid maintainers, there is a ctypes for armel. As far as I know, ctypes on arm was a problem quite some time ago.

As for OpenGL ES, the maemo experiments have some potentially useful stuff, in particular glesport. It isn't maintained (last change one year ago), but it may still prove useful.
 
In the thread about Citadel MMO Sinbad talked about cocos2d and I noticed that there is an iPhone version, so maybe it can be ported to pandora, I also noticed that cocos2d is based on pylget (according to the homepage) so if cocos2d has an ARM/OpenGL|ES then maybe some parts can be used for a pyglet port maybe? But maybe that version don't use pyglet...

sindbad said:
[...]

Pixel art is unacceptable these days, you must use SVG if you want it to look good everywhere and at any angle.

For an engine, http://cocos2d.org/ is pretty cool (python only), I haven't tried others. There isn't much point in using a 3D engine, but it would be possible.
You could use a 2D physics engine to make stuff more fun and easier to program and here you basically have 2 choices: box2d or chipmunk. After using both for a bit, I found chipmunk to be more general, customisable and robust. It's also written in C, which makes using it from other languages that much easier. Personal taste has a lot to do with this.
In a worst case scenario, you could use SDL, but it's 2D graphics is a bit slow and it's certainly not an engine.

[...]
 
Last edited by a moderator:
Back
Top