[Sugar-devel] [PATCH Maze 4/4] Save and restore state of the game

Rafael Ortiz rafael at activitycentral.com
Thu Mar 22 00:36:57 EDT 2012


On Wed, Mar 21, 2012 at 5:27 PM, James Cameron <quozl at laptop.org> wrote:

> On Tue, Mar 20, 2012 at 10:52:54PM -0300, Manuel Kaufmann wrote:
> > Ability to 'save' (when the user closes the Activity) and 'restore'
> (when the
> > user launch it from the Journal or the Home without holding Alt) the
> state of
> > the game.
> >
> > For this ability I had to upgrade 'olpcgames' to 1.6 because
> > 'olpcgames.FILE_READ_REQUEST' and 'olpcgames.FILE_WRITE_REQUEST' events
> are
> > added in that version and those events are needed for this.
> >
> > The data is saved (as JSON, with simplejson module) in the
> 'event.filename'
> > path using the 'sugar.datastore' API.
> >
> > A filename example is:
> >
> >  ~/.sugar/default/datastore/09/0940b7eb-1cb7-4687-aa7a-ac2c174dcfd7/data
> >
> > This commit solves ticket #2393:
> >  * http://bugs.sugarlabs.org/ticket/2393
>
> Reviewed-by: James Cameron <quozl at laptop.org>
>
> Contrary to Gonzalo, I don't think the olpcgames and game.py changes
> should be separated, since they are entirely interdependent.  Applying.
> one change or the other does not lead to working code.  Both are
> required.
>
>
+1. although its simpler (having two patches), I don't think its necessary
as per Jame's comment.


Thanks to humitos for the patches.



> --
> James Cameron
> http://quozl.linux.org.au/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120321/ab5d8cb5/attachment.html>


More information about the Sugar-devel mailing list