[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - pymunk, a chipmunk python binding.

pymunk, a chipmunk python binding.

Share your projects and Chipmunk enhancements.

Re: pymunk, a chipmunk python binding.

Postby viblo » Thu Mar 06, 2008 5:50 pm

http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm

Re: pymunk, a chipmunk python binding.

Postby crazy-chris » Thu Mar 06, 2008 7:15 pm

crazy-chris
 
Posts: 7
Joined: Tue Mar 04, 2008 3:40 am

Re: pymunk, a chipmunk python binding.

Postby viblo » Thu May 01, 2008 1:15 pm

I made an update to the first post (and this post is just to bump to make the forum mark the thread for those who might be interested).
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm

Re: pymunk, a chipmunk python binding.

Postby viblo » Sun Jun 15, 2008 4:20 pm

I made yet another update to the first post for the newly released pymunk 0.8 (and this post is just to bump to make the forum mark the thread for those who might be interested).
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm

Re: pymunk, a chipmunk python binding.

Postby viblo » Sat Nov 01, 2008 7:21 pm

pymunk 0.8.1 is now released, see the first post in this thread and http://code.google.com/p/pymunk for details (this post is just to bump the thread to make the forum mark the thread for those who might be interested).
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm

Re: pymunk, a chipmunk python binding.

Postby JoeStrout » Fri Nov 28, 2008 11:51 pm

Thank you so much for Pymunk! I've just discovered it this evening and have been playing with it for about an hour, and already I love it.

There's one thing I can't figure out, though: how can I detect collisions? For example, I want to play a little "bonk" sound every time a ball bumps into something. In Chipmunk, it looks like I can use a "collision pair function" for that. But I don't see anything like that in pymunk. Am I missing it, or is pymunk?

Thanks,
- Joe
JoeStrout
 
Posts: 7
Joined: Fri Nov 28, 2008 11:46 pm

Re: pymunk, a chipmunk python binding.

Postby viblo » Sat Nov 29, 2008 6:25 am

There are two examples on how to detect collisions in the examples dir of pymunk (demo_contact.py and demo_contact_with_callback.py).

However, you probably want to add some little logic to use it for sound playing as you want the sound to only play once for a collision but in reality chipmunk might take a couple of frames to resolve the collision (each time generating a callback), and you dont want the sound each frame if for example a ball is placed on a table.

There are a couple of ways you can handle it, and which way is best depends on your game/program, for example only play sound if the penetration distance is greater than a specific number, or play it if the impulses used to resolve the collision is greater than a specific number (I think this is better than penetration distance in most cases), or if the two objects didn't collide last frame. Take a look at this thread on the same problem: viewtopic.php?f=1&t=182&p=1374&hilit=sound#p1374 (not pymunk specific, but Im sure you can decode it, otherwise post here I can try to translate it to python/pymunk)

I have used a simple "if objects didnt collide last frame then do collision stuff (play sound, do game logic)" algorithm in a game me and a friend made for pyweek, http://pyweek.org/e/Bouncy/ But in that game we didnt want to play sound on all collisions, just when the objects had some interaction like when a ball hit a gravity twister or bouncer. (Note: If you look at its source remember that pymunk has changed since then and that the source was written very quickly)
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm

Re: pymunk, a chipmunk python binding.

Postby JoeStrout » Sat Nov 29, 2008 9:11 am

Thank you, that all makes perfect sense. I'm going to update a few of the demos to "bonk" properly. Would you like me to submit them back for possible inclusion in the next version of pymunk?
JoeStrout
 
Posts: 7
Joined: Fri Nov 28, 2008 11:46 pm

Re: pymunk, a chipmunk python binding.

Postby viblo » Sat Nov 29, 2008 10:22 am

http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm

Re: pymunk, a chipmunk python binding.

Postby viblo » Sat Apr 18, 2009 7:59 am

http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm

PreviousNext

Return to Community Creations

Who is online

Users browsing this forum: No registered users and 1 guest

cron