Elements

From OLPC
Revision as of 19:56, 18 May 2010 by 70.132.7.73 (talk) (Undo revision 235266 by 123.53.123.179 (Talk))
Jump to: navigation, search

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


We have [url=http://www.famousbrandshop.com/]Christian Louboutin[/url]selected[url=http://abercrombie-worlds.com/]cheap abercrombie[/url] three [url=http://greattiffanyjewelry.com/]fashion Tiffany[/url]of my [url=http://www.msmrshopping.com/]snow boots[/url]personal[url=http://www.sportjerseyssale.com/]jerseys on sale[/url] favorite [url=http://www.sportjerseyssale.com/mlb-jerseys-c-4.html]MLB Jerseys[/url]styles [url=http://www.famousbrandshop.com/Christian-Louboutin-Sandals/c6/index.html]Christian Louboutin Sandals[/url]that [url=http://www.famousbrandshop.com/Christian-Louboutin-Boots/c3/index.html]Christian Louboutin Boots[/url]will [url=http://abercrombie-worlds.com/Abercrombie-Women-Polos/c23/index.html]Abercrombie Women Polos[/url]help you [url=http://abercrombie-worlds.com/Abercrombie-Men-Classic-Shirts/c19/index.html]Abercrombie Men Classic Shirts[/url]gain [url=http://greattiffanyjewelry.com/Tiffany-&-Co.-Chains/c15/index.html]Tiffany & Co. Chains[/url]a new [url=http://greattiffanyjewelry.com/Tiffany-&-Co.-Cufflinks/c16/index.html]Tiffany & Co. Cufflinks[/url]love [url=http://www.msmrshopping.com/UGG-Australia-Women's-Gissella/c30/index.html]UGG Australia Womens Gissella[/url]for an [url=http://www.msmrshopping.com/UGG-Australia-Women's-Highkoo/c31/index.html]UGG Australia Womens Highkoo[/url]accessory like a purse[url=http://abercrombie-worlds.com/Abercrombie-Women-Fur-Hoodies/c21/index.html]Abercrombie Women Fur Hoodies[/url]. The very [url=http://www.msmrshopping.com/UGG-Australia-Women's-Sandals/c5/index.html]UGG Australia Women's Sandals[/url]first of[url=http://www.famousbrandbag.com/]Fake Handbags[/url] the three [url=http://www.famousbrandbag.com/]Discount Handbags[/url]unique handbags[url=http://www.famousbrandbag.com/Balenciaga/c30/index.html]Balenciaga handbags[/url] is the [url=http://www.famousbrandbag.com/Cartier/c44/index.html]Cartier handbags[/url]Hobo. This[url=http://www.famousbrandbag.com/Chloe/c31/index.html]Chloe handbags[/url] particular bag [url=http://www.famousbrandbag.com/Bally/c37/index.html]Bally handbags[/url]is fantastic[url=http://www.famousbrandbag.com/Givenchy/c45/index.html]Givenchy handbags[/url]as it offers a youthful [url=http://www.famousbrandbag.com/Mulberry/c38/index.html]Mulberry handbags[/url]style in a very casual style. [url=http://brandstore666.com/Famous-Gucci-Snake-Leather-Shopping-Bag-Silver-178652_p4820.html]Famous Gucci Snake Leather ShoppingBag-Silver 178652[/url] [url=http://brandstore666.com/Famous-Gucci-Wrinkle-Japannned-Cowhide-Leather-Bag-Black-177139_p4795.html]Famous Gucci WrinkleJapannned Cowhide Leather Bag-Black 177139[/url] [url=http://brandstore666.com/Famous-Guccic-Cowhide-Embossed-Bag-Beige-189019_p4910.html]Famous Guccic Cowhide Embossed Bag-Beige189019[/url] [url=http://brandstore666.com/Famous-Guccic-Cowhide-Embossed-Bag-Black-189019_p4906.html]Famous Guccic Cowhide Embossed Bag-Black189019[/url] [url=http://brandstore666.com/Famous-Guccic-Cowhide-Embossed-Bag-Light-Coffee-189019_p4915.html]Famous Guccic Cowhide EmbossedBag-Light Coffee 189019[/url] [url=http://brandstore666.com/Famous-Guccic-Cowhide-Embossed-Bag-Offwhite-189019_p4908.html]Famous Guccic Cowhide EmbossedBag-Offwhite 189019[/url]

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)