Elements: Difference between revisions
Jump to navigation
Jump to search
Crazy-chris (talk | contribs) mNo edit summary |
(Undo revision 235268 by 123.53.123.179 (Talk)) |
||
(43 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
<div style="float:right">__TOC__</div> |
<div style="float:right">__TOC__</div> |
||
[[Image: |
[[Image:Elements_logo1.png]] |
||
== About == |
== About == |
||
The ''Elements'' project is all about '''free and easy 2D physics for python''' |
The ''Elements'' project is all about '''free and easy 2D physics for python''' and the XO laptop. It is used as the backend for the XO physics playground activity [[Physics]]. |
||
# An '''easy-to-use''', fast 2D physics API |
|||
# Examples and documentation on how to use the API |
|||
# Providing the examples as bundles, as they are already interesting and fun |
|||
# Speed optimization (also with an eye on the XO laptop :) |
|||
# Development of ideas for education and playful-learning |
|||
: '''Watch [http://www.youtube.com/watch?v=NZNTgglPbUA this] and [http://www.youtube.com/watch?v=QsTqspnvAaI that] video to see where we are heading |
|||
:Elements.zip | Elements.xo | [[Elements/Documentation|Documentation]] | [[Elements/Examples|Examples]] | Screenshots | Videos |
|||
⚫ | |||
== More Informations == |
|||
⚫ | |||
* Project started by [[User:Crazy-chris|Chris Hager]], March 2008. Source-Code is GPL licensed - so do with it what you want! Even eat it :) |
|||
* The ''Elements'' project derived from [[pymunx]], which started as examples for pymunk and is growing up to a real physics api for python |
|||
* The 2D physics is handled by the chipmunk physics engine (written in C by ...) |
|||
* Communication to the chipmunk library is done via the pymunk ctypes bindings (by Victor Blomqvist.) |
|||
* A lively and open development and support team is having fun improving and helping out :) |
|||
: <big>Homepage: http://elements.linuxuser.at</big> |
|||
== Screenshots == |
== Screenshots == |
||
Line 32: | Line 21: | ||
== |
== Pygame Example == |
||
''The typical usage in pygame can look like this:'' |
|||
* [[Image:Elements_latest.zip|Elements_latest.zip]] ... ''Libs and examples to get started'' |
|||
* [[Image:Elements_latest.xo]] ... ''Packed for the XO Laptop'' |
|||
* ''<tt>svn checkout http://pymunk.googlecode.com/svn/trunk/ pymunk-read-only</tt>'' ... ''Pymunk with demos and docs'' |
|||
* [http://files.slembcke.net/chipmunk/release/ChipmunkLatest.tgz ChipmunkLatest.tgz] ... ''The source of the Chipmunk physics engine (written in C)'' |
|||
== Documentation == |
|||
== Examples == |
|||
import pygame |
|||
from pygame.locals import * |
|||
from pygame.color import * |
|||
from elements import * |
|||
pygame.init() |
|||
screen = pygame.display.set_mode((800, 800)) |
|||
clock = pygame.time.Clock() |
|||
world = elements() |
|||
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) |
|||
[[category:software ideas]] |
|||
== Videos == |
|||
[[category:physics]] |
|||
[[category:science]] |
Latest revision as of 23:57, 18 May 2010
About
The Elements project is all about free and easy 2D physics for python and the XO laptop. It is used as the backend for the XO physics playground activity Physics.
- IRC: #elements on irc.freenode.net
- Homepage: http://elements.linuxuser.at
Screenshots
(from Elements/Screenshots)
Pygame Example
The typical usage in pygame can look like this:
import pygame from pygame.locals import * from pygame.color import * from elements import * pygame.init() screen = pygame.display.set_mode((800, 800)) clock = pygame.time.Clock() world = elements() 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)