Pymunx: Difference between revisions
Jump to navigation
Jump to search
Crazy-chris (talk | contribs) (init) |
Crazy-chris (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
<div style="float:left;width:100px;">[[Image:Pymunx_80px.png]]</div> |
|||
''pymunx'' is an API for easily integrating physics into python (pygame), using the pymunk bindings for the chipmunks physics engine. |
''pymunx'' is an API for easily integrating physics into python (pygame), using the pymunk bindings for the chipmunks physics engine. |
||
Line 4: | Line 5: | ||
[http://www.linuxuser.at/pymunx/pymunx.py pymunx.py] contains the api class with all documentation on how to find, install and use everything :). A good (and the only) demo for pymunx is [http://www.linuxuser.at/pymunx/pymunx_demo1.py pymunx_demo1.py], I'd recomment having a look into [http://code.google.com/p/pymunk/ pymunk] with it's good examples as well. |
[http://www.linuxuser.at/pymunx/pymunx.py pymunx.py] contains the api class with all documentation on how to find, install and use everything :). A good (and the only) demo for pymunx is [http://www.linuxuser.at/pymunx/pymunx_demo1.py pymunx_demo1.py], I'd recomment having a look into [http://code.google.com/p/pymunk/ pymunk] with it's good examples as well. |
||
The typical usage in pygame looks like this: |
The typical usage in pygame looks like this: |
Revision as of 00:18, 8 March 2008
pymunx is an API for easily integrating physics into python (pygame), using the pymunk bindings for the chipmunks physics engine.
The status is very early and experimental. It's already testable, but many functions of pymunk are not yet usable. I'm quite on it and will post updates frequently the next time, so check back often :) I'll post my updates and demos here: http://www.linuxuser.at/pymunx, and there's also a Forum shared with pymunk and chipmunk.
pymunx.py contains the api class with all documentation on how to find, install and use everything :). A good (and the only) demo for pymunx is pymunx_demo1.py, I'd recomment having a look into pymunk with it's good examples as well.
The typical usage in pygame looks like this:
import pygame from pygame.locals import * from pygame.color import * from pymunx import * pygame.init() screen = pygame.display.set_mode((800, 800)) clock = pygame.time.Clock() world = pymunx() world.add_wall((100, 200), (300, 200)) # Main Game Loop: while running: # Event Handling # Maybe calling world.add_ball(event.pos) or world.add_square(event.pos) # ... screen.fill((255,255,255)) # Update & Draw World world.update() world.draw(screen) # Flip Display pygame.display.flip() # Try to stay at 50 FPS clock.tick(50)