Changes

Jump to navigation Jump to search
no edit summary
Line 2: Line 2:     
Sugargame is a Python package which allows [http://www.pygame.org/ Pygame]  
 
Sugargame is a Python package which allows [http://www.pygame.org/ Pygame]  
programs to run well under Sugar.  
+
programs to run well under Sugar.
It is fork of the olcpgames framework, which is no longer maintained.
+
It is a fork of olcpgames, which is no longer maintained.
 
  −
http://git.sugarlabs.org/projects/sugargame
      
What it does:
 
What it does:
Line 13: Line 11:  
* Provides hooks for saving to and restoring from the Journal
 
* Provides hooks for saving to and restoring from the Journal
   −
==== Differences between Sugargame and olpcgames ====
+
Get it from:
   −
The olpcgames framework provides a wrapper around Pygame which attempts to
+
http://github.com/sugarlabs/sugargame
allow a Pygame program to run mostly unmodified under Sugar.  To this end,
  −
the Pygame program is run in a separate thread with its own Pygame message
  −
loop while the main thread runs the GTK message loop.  Also, olpcgames wraps
  −
Sugar APIs such as the journal and mesh into a Pygame-like API.
     −
Sugargame takes a simpler approach; it provides a way to embed Pygame into a
+
And place it within your activity sourceIt is not part of Sugar.  Remember to check back for updates when you are continuing development of your activity.
GTK widgetThe Sugar APIs are used to interact with Sugar, the Pygame APIs
  −
are used for the game.
     −
Sugargame advantages:
+
You can find it in some activities already.  It is so small that the duplication is unimportant.
 
  −
* Simpler code
  −
* More elegant interface between Pygame and GTK
  −
* Runs as a single thread: no thread related segfaults
  −
* Possible to use Sugar widgets with Pygame
  −
 
  −
Sugargame limitations:
  −
 
  −
* No support for Pango or SVG sprites (yet)
      
== Using Sugargame ==
 
== Using Sugargame ==
Line 42: Line 25:  
==== Wrapping a Pygame program ====
 
==== Wrapping a Pygame program ====
   −
To use Sugargame to Sugarize a Pygame program, set up an activity directory and copy the Sugargame package to it.
+
To use Sugargame to Sugarize a Pygame program, set up an activity directory and copy the Sugargame package into it. For an example, see the directory named test, inside the Sugargame repository.  It is in fact a Sugargame activity.  
    
The activity directory should look something like this:
 
The activity directory should look something like this:
Line 128: Line 111:  
the One Laptop per Child project.
 
the One Laptop per Child project.
   −
=== Changelog ===
+
== Changelog ==
   −
====v1.1====
+
===v1.1===
 
* Fix bugs in event handling.  (Pablo Moleri)
 
* Fix bugs in event handling.  (Pablo Moleri)
 
* Remove reference to gtk.Socket.get_window() method, which is missing in older versions of PyGTK.
 
* Remove reference to gtk.Socket.get_window() method, which is missing in older versions of PyGTK.
   −
====v1.0====
+
===v1.0===
 
* Initial version of Sugargame
 
* Initial version of Sugargame
 +
 +
== Differences between Sugargame and olpcgames ==
 +
 +
The olpcgames framework provides a wrapper around Pygame which attempts to
 +
allow a Pygame program to run mostly unmodified under Sugar.  To this end,
 +
the Pygame program is run in a separate thread with its own Pygame message
 +
loop while the main thread runs the GTK message loop.  Also, olpcgames wraps
 +
Sugar APIs such as the journal and mesh into a Pygame-like API.
 +
 +
Sugargame takes a simpler approach; it provides a way to embed Pygame into a
 +
GTK widget.  The Sugar APIs are used to interact with Sugar, the Pygame APIs
 +
are used for the game. 
 +
 +
Sugargame advantages:
 +
 +
* Simpler code
 +
* More elegant interface between Pygame and GTK
 +
* Runs as a single thread: no thread related segfaults
 +
* Possible to use Sugar widgets with Pygame
 +
 +
Sugargame limitations:
 +
 +
* No support for Pango or SVG sprites (yet)

Navigation menu