Elements: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (→‎About: added another video.)
(Undo revision 235268 by 123.53.123.179 (Talk))
 
(9 intermediate revisions by 6 users not shown)
Line 3: Line 3:


== About ==
== About ==
The ''Elements'' project is all about '''free and easy 2D physics for python''' and the XO laptop.
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]].




: '''Watch [http://www.youtube.com/watch?v=NZNTgglPbUA this] , [http://www.youtube.com/watch?v=QsTqspnvAaI this] , and [http://www.youtube.com/watch?v=d7eGypGOlOc&NR=1 this] video to see where we are heading
: '''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


: IRC: '''#elements''' on irc.freenode.net
: IRC: '''#elements''' on irc.freenode.net
Line 12: Line 12:


: <big>Homepage: http://elements.linuxuser.at</big>
: <big>Homepage: http://elements.linuxuser.at</big>

== Team ==
* [[User:Crazy-chris|Chris Hager]] (Coordination, API)
* Joshua Minor (API, Examples)
* [[User:Jaume|Jaume Nualart]] (Support, testing)
* [[User:Ixo|iXo (Iain Davidson) ]] (Support)
* Ken (SWIG interface, API)
* Victor Blomqvist (Author of pymunk)
''The team is open for anyone to join :)''



== Screenshots ==
== Screenshots ==
Line 65: Line 55:
clock.tick(50)
clock.tick(50)


[[category:software]]
[[category:software ideas]]
[[category:physics]]
[[category:physics]]
[[category:science]]
[[category:science]]

Latest revision as of 23:57, 18 May 2010

Elements logo1.png

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.


Watch this and that video to see where we are heading
IRC: #elements on irc.freenode.net


Homepage: http://elements.linuxuser.at

Screenshots

(from Elements/Screenshots)

Screenshot1.png Screenshot2.png

Screenshot3.png Screenshot4.png


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)