Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/game.py
Commit message (Collapse)AuthorAgeFilesLines
* Avoid K_ESCAPE to quit the game SL #3461Manuel Kaufmann2012-06-011-3/+1
| | | | | | | This is an old pygame behavior that we don't need in Sugar. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Signed-off-by: Rafael Ortiz <rafael@activitycentral.com>
* Collaboration: allow multiple users in the same XOManuel Kaufmann2012-04-201-7/+20
| | | | | | | | | | | | | | | | This is a workaround to the problem with the real nick on a jabber server[1]. Now, we are using the unique identifier (mesh.my_handle or event.handle) for each player in the game plus a "-%d" at the end of the uid. This value (Player.uid) is added only when the Activity is shared otherwise this field is None. This new workaround allow to distinguish between many users (up to 3) for each XO laptop -using the gamepad keys. [1] http://dev.laptop.org/ticket/10750 Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Signed-off-by: Rafael Ortiz <rafael@activitycentral.com>
* Allow collaboration (SL #3296)Manuel Kaufmann2012-04-161-36/+52
| | | | | | | | | | | | | | | | | | | | Replaced "get_buddy" function by "lookup_buddy" as suggested the Error message. In this version is not allowed to play with more than one player in each XO (using the gamepad keywords). This is because a known issue [1] and we can not handle the child's nick properly. The "mesh.PARTICIPANT_ADD" event sends something like "6be01ff2bcfaa58eeacc7f10a57b77b65470d413@jabber.sugarlabs.org" in the "buddy.prosp.nick" variable and the "mesh.broadcast" send the correct child's name. So, when Maze creates the players uses the mesh.PARTICIPANT_ADD value and when it reads the messages it find the correct name (the name that the child chose) [1] http://dev.laptop.org/ticket/10750 Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Signed-off-by: Rafael Ortiz <rafael@activitycentral.com>
* coding utf-8 fixesRafael Ortiz2012-04-101-0/+2
|
* going back to v16 because a regretion.Rafael Ortiz2012-04-101-1/+6
|
* Save and restore state of the gameManuel Kaufmann2012-03-281-5/+44
| | | | | | | | | | | | | | | | | | 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 json module) in the 'event.metadata["state"]' and the timestamp state is saved in 'event.filename'. This commit solves ticket #2393: * http://bugs.sugarlabs.org/ticket/2393 Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Signed-off-by: Rafael Ortiz <rafael@activitycentral.com>
* some pep8 errors fixedManuel Kaufmann2012-03-271-133/+182
| | | | | | | | - removed a lot of trailing slashes - added spaces between operators - splited lines with more than 80 chars Signed-off-by: Rafael Ortiz <rafael@activitycentral.com>
* Adds support for touchpad input. By adding this, touchscreen input is alsoRafael Ortiz2012-01-161-1/+32
| | | | | | | | supported. The functionality is to use touchpad gestures instead of pressing the arrow keys. The mouse button must be pressed for the gesture to be interpreted, so jumpy touchpads won't affect play. by John Watlington wad@laptop.org
* fix for olpc #11231 (wrong dimensions in pygame activities) by james cameronRafael Ortiz2011-09-191-2/+5
|
* Ordering filesRafael Ortiz2011-05-131-0/+458