Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2011-05-13 16:22:04 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2011-05-13 16:22:04 (GMT)
commit56cf33caa9569b59f6ebb56a61ba43af3080b274 (patch)
tree3c0b72c12c9fb9b1505a9ad79d108837bf881b44
parente50ef664cb553acfa1c14ea541028a7e5a34d346 (diff)
Ordering files
-rw-r--r--COPYING (renamed from Maze.activity/COPYING)0
-rw-r--r--MANIFEST (renamed from Maze.activity/MANIFEST)0
-rw-r--r--Maze.activity/po/Maze.pot21
-rw-r--r--Maze.activity/po/es.po21
-rw-r--r--NEWS (renamed from Maze.activity/NEWS)0
-rwxr-xr-xactivity.py (renamed from Maze.activity/activity.py)0
-rw-r--r--activity/activity-maze.svg (renamed from Maze.activity/activity/activity-maze.svg)0
-rw-r--r--activity/activity.info (renamed from Maze.activity/activity/activity.info)0
-rw-r--r--game.py (renamed from Maze.activity/game.py)0
-rw-r--r--maze.py (renamed from Maze.activity/maze.py)0
-rwxr-xr-xmy_cursor.xbm (renamed from Maze.activity/my_cursor.xbm)0
-rwxr-xr-xmy_cursor_mask.xbm (renamed from Maze.activity/my_cursor_mask.xbm)0
-rw-r--r--olpcgames/COPYING (renamed from Maze.activity/olpcgames/COPYING)0
-rw-r--r--olpcgames/__init__.py (renamed from Maze.activity/olpcgames/__init__.py)0
-rw-r--r--olpcgames/_cairoimage.py (renamed from Maze.activity/olpcgames/_cairoimage.py)0
-rw-r--r--olpcgames/activity.py (renamed from Maze.activity/olpcgames/activity.py)0
-rw-r--r--olpcgames/camera.py (renamed from Maze.activity/olpcgames/camera.py)0
-rw-r--r--olpcgames/canvas.py (renamed from Maze.activity/olpcgames/canvas.py)0
-rw-r--r--olpcgames/data/__init__.py (renamed from Maze.activity/olpcgames/data/__init__.py)0
-rw-r--r--olpcgames/data/sleeping_svg.py (renamed from Maze.activity/olpcgames/data/sleeping_svg.py)0
-rw-r--r--olpcgames/eventwrap.py (renamed from Maze.activity/olpcgames/eventwrap.py)0
-rw-r--r--olpcgames/gtkEvent.py (renamed from Maze.activity/olpcgames/gtkEvent.py)0
-rw-r--r--olpcgames/mesh.py (renamed from Maze.activity/olpcgames/mesh.py)0
-rw-r--r--olpcgames/mybutton.py (renamed from Maze.activity/olpcgames/mybutton.py)0
-rw-r--r--olpcgames/pangofont.py (renamed from Maze.activity/olpcgames/pangofont.py)0
-rw-r--r--olpcgames/pausescreen.py (renamed from Maze.activity/olpcgames/pausescreen.py)0
-rw-r--r--olpcgames/svgsprite.py (renamed from Maze.activity/olpcgames/svgsprite.py)0
-rw-r--r--olpcgames/util.py (renamed from Maze.activity/olpcgames/util.py)0
-rw-r--r--olpcgames/video.py (renamed from Maze.activity/olpcgames/video.py)0
-rw-r--r--player.py (renamed from Maze.activity/player.py)48
-rwxr-xr-xpo/Maze.pot2
-rwxr-xr-xpo/es.po26
-rwxr-xr-xsetup.py (renamed from Maze.activity/setup.py)0
33 files changed, 27 insertions, 91 deletions
diff --git a/Maze.activity/COPYING b/COPYING
index 20d40b6..20d40b6 100644
--- a/Maze.activity/COPYING
+++ b/COPYING
diff --git a/Maze.activity/MANIFEST b/MANIFEST
index 796d5ca..796d5ca 100644
--- a/Maze.activity/MANIFEST
+++ b/MANIFEST
diff --git a/Maze.activity/po/Maze.pot b/Maze.activity/po/Maze.pot
deleted file mode 100644
index 5c66ad6..0000000
--- a/Maze.activity/po/Maze.pot
+++ /dev/null
@@ -1,21 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-02-01 11:32+0000\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: activity/activity.info:2
-msgid "Maze"
-msgstr ""
diff --git a/Maze.activity/po/es.po b/Maze.activity/po/es.po
deleted file mode 100644
index bc74f53..0000000
--- a/Maze.activity/po/es.po
+++ /dev/null
@@ -1,21 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-02-01 11:32+0000\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: activity/activity.info:2
-msgid "Maze"
-msgstr "Laberinto"
diff --git a/Maze.activity/NEWS b/NEWS
index 96c16c8..96c16c8 100644
--- a/Maze.activity/NEWS
+++ b/NEWS
diff --git a/Maze.activity/activity.py b/activity.py
index dbf6940..dbf6940 100755
--- a/Maze.activity/activity.py
+++ b/activity.py
diff --git a/Maze.activity/activity/activity-maze.svg b/activity/activity-maze.svg
index cb2cad0..cb2cad0 100644
--- a/Maze.activity/activity/activity-maze.svg
+++ b/activity/activity-maze.svg
diff --git a/Maze.activity/activity/activity.info b/activity/activity.info
index 80fec58..80fec58 100644
--- a/Maze.activity/activity/activity.info
+++ b/activity/activity.info
diff --git a/Maze.activity/game.py b/game.py
index 692c136..692c136 100644
--- a/Maze.activity/game.py
+++ b/game.py
diff --git a/Maze.activity/maze.py b/maze.py
index 8fec99c..8fec99c 100644
--- a/Maze.activity/maze.py
+++ b/maze.py
diff --git a/Maze.activity/my_cursor.xbm b/my_cursor.xbm
index 2ffac88..2ffac88 100755
--- a/Maze.activity/my_cursor.xbm
+++ b/my_cursor.xbm
diff --git a/Maze.activity/my_cursor_mask.xbm b/my_cursor_mask.xbm
index 944cf7d..944cf7d 100755
--- a/Maze.activity/my_cursor_mask.xbm
+++ b/my_cursor_mask.xbm
diff --git a/Maze.activity/olpcgames/COPYING b/olpcgames/COPYING
index b8adee0..b8adee0 100644
--- a/Maze.activity/olpcgames/COPYING
+++ b/olpcgames/COPYING
diff --git a/Maze.activity/olpcgames/__init__.py b/olpcgames/__init__.py
index 5fd28b7..5fd28b7 100644
--- a/Maze.activity/olpcgames/__init__.py
+++ b/olpcgames/__init__.py
diff --git a/Maze.activity/olpcgames/_cairoimage.py b/olpcgames/_cairoimage.py
index 302b916..302b916 100644
--- a/Maze.activity/olpcgames/_cairoimage.py
+++ b/olpcgames/_cairoimage.py
diff --git a/Maze.activity/olpcgames/activity.py b/olpcgames/activity.py
index 27392ea..27392ea 100644
--- a/Maze.activity/olpcgames/activity.py
+++ b/olpcgames/activity.py
diff --git a/Maze.activity/olpcgames/camera.py b/olpcgames/camera.py
index b51a394..b51a394 100644
--- a/Maze.activity/olpcgames/camera.py
+++ b/olpcgames/camera.py
diff --git a/Maze.activity/olpcgames/canvas.py b/olpcgames/canvas.py
index 0874d2d..0874d2d 100644
--- a/Maze.activity/olpcgames/canvas.py
+++ b/olpcgames/canvas.py
diff --git a/Maze.activity/olpcgames/data/__init__.py b/olpcgames/data/__init__.py
index 8510186..8510186 100644
--- a/Maze.activity/olpcgames/data/__init__.py
+++ b/olpcgames/data/__init__.py
diff --git a/Maze.activity/olpcgames/data/sleeping_svg.py b/olpcgames/data/sleeping_svg.py
index fa67eee..fa67eee 100644
--- a/Maze.activity/olpcgames/data/sleeping_svg.py
+++ b/olpcgames/data/sleeping_svg.py
diff --git a/Maze.activity/olpcgames/eventwrap.py b/olpcgames/eventwrap.py
index 92fbabb..92fbabb 100644
--- a/Maze.activity/olpcgames/eventwrap.py
+++ b/olpcgames/eventwrap.py
diff --git a/Maze.activity/olpcgames/gtkEvent.py b/olpcgames/gtkEvent.py
index ce4f9eb..ce4f9eb 100644
--- a/Maze.activity/olpcgames/gtkEvent.py
+++ b/olpcgames/gtkEvent.py
diff --git a/Maze.activity/olpcgames/mesh.py b/olpcgames/mesh.py
index 254089f..254089f 100644
--- a/Maze.activity/olpcgames/mesh.py
+++ b/olpcgames/mesh.py
diff --git a/Maze.activity/olpcgames/mybutton.py b/olpcgames/mybutton.py
index 2d1677d..2d1677d 100644
--- a/Maze.activity/olpcgames/mybutton.py
+++ b/olpcgames/mybutton.py
diff --git a/Maze.activity/olpcgames/pangofont.py b/olpcgames/pangofont.py
index 81a2d7c..81a2d7c 100644
--- a/Maze.activity/olpcgames/pangofont.py
+++ b/olpcgames/pangofont.py
diff --git a/Maze.activity/olpcgames/pausescreen.py b/olpcgames/pausescreen.py
index 1c1d6c3..1c1d6c3 100644
--- a/Maze.activity/olpcgames/pausescreen.py
+++ b/olpcgames/pausescreen.py
diff --git a/Maze.activity/olpcgames/svgsprite.py b/olpcgames/svgsprite.py
index 2c53178..2c53178 100644
--- a/Maze.activity/olpcgames/svgsprite.py
+++ b/olpcgames/svgsprite.py
diff --git a/Maze.activity/olpcgames/util.py b/olpcgames/util.py
index f4ecbf0..f4ecbf0 100644
--- a/Maze.activity/olpcgames/util.py
+++ b/olpcgames/util.py
diff --git a/Maze.activity/olpcgames/video.py b/olpcgames/video.py
index 0cf9ac9..0cf9ac9 100644
--- a/Maze.activity/olpcgames/video.py
+++ b/olpcgames/video.py
diff --git a/Maze.activity/player.py b/player.py
index d9421a3..4ece679 100644
--- a/Maze.activity/player.py
+++ b/player.py
@@ -25,15 +25,18 @@ bundlepath = get_bundle_path()
from sugar.graphics.icon import Icon
from sugar.graphics.xocolor import XoColor
import pygame
-import re, os
+import re
+import os
+
class Player:
def __init__(self, buddy, shape='circle'):
self.buddy = buddy
self.nick = buddy.props.nick
colors = buddy.props.color.split(",")
+
def string2Color(str):
- return (int(str[1:3],16), int(str[3:5],16), int(str[5:7],16))
+ return (int(str[1:3], 16), int(str[3:5], 16), int(str[5:7], 16))
self.colors = map(string2Color, colors)
self.shape = shape
self.hidden = False
@@ -41,9 +44,9 @@ class Player:
self.reset()
def draw(self, screen, bounds, size):
- rect = pygame.Rect(bounds.x+self.position[0]*size, bounds.y+self.position[1]*size, size, size)
+ rect = pygame.Rect(bounds.x + self.position[0] * size, bounds.y + self.position[1] * size, size, size)
border = size / 10.
- center = rect.inflate(-border*2, -border*2)
+ center = rect.inflate(-border * 2, - border * 2)
fg, bg = self.colors
if self.shape == 'circle':
pygame.draw.ellipse(screen, fg, rect, 0)
@@ -52,54 +55,54 @@ class Player:
pygame.draw.rect(screen, fg, rect, 0)
pygame.draw.rect(screen, bg, center, 0)
elif self.shape == 'triangle':
- rect = rect.inflate(-1,-1)
+ rect = rect.inflate(-1, -1)
pts = [rect.bottomleft, rect.midtop, rect.bottomright]
pygame.draw.polygon(screen, fg, pts, 0)
- pts = [(pts[0][0]+border*1.394, pts[0][1]-border),
- (pts[1][0], pts[1][1]+border*2.236),
- (pts[2][0]-border*1.394, pts[2][1]-border)]
+ pts = [(pts[0][0] + border * 1.394, pts[0][1] - border),
+ (pts[1][0], pts[1][1] + border * 2.236),
+ (pts[2][0] - border * 1.394, pts[2][1] - border)]
pygame.draw.polygon(screen, bg, pts, 0)
def reset(self):
- self.direction = (0,0)
- self.position = (1,1)
- self.previous = (1,1)
+ self.direction = (0, 0)
+ self.position = (1, 1)
+ self.previous = (1, 1)
self.elapsed = None
def animate(self, maze):
# if the player finished the maze, then don't move
if maze.map[self.position[0]][self.position[1]] == maze.GOAL:
- self.direction=(0,0)
- if self.direction == (0,0):
+ self.direction = (0, 0)
+ if self.direction == (0, 0):
return self.position
if self.canGo(self.direction, maze):
self.move(self.direction, maze)
self.keepGoing(self.direction, maze)
else:
- self.direction = (0,0)
+ self.direction = (0, 0)
return self.position
def move(self, direction, maze):
"""Move the player in a given direction (deltax,deltay)"""
- newposition = (self.position[0]+direction[0], self.position[1]+direction[1])
+ newposition = (self.position[0] + direction[0], self.position[1] + direction[1])
self.previous = self.position
self.position = newposition
def canGo(self, direction, maze):
- """Can the player go in this direction without bumping into something?"""
- newposition = (self.position[0]+direction[0], self.position[1]+direction[1])
+ """Can the player go in this direction without bumping into somethi ng?"""
+ newposition = (self.position[0] + direction[0], self.position[1] + direction[1])
return maze.validMove(newposition[0], newposition[1])
def cameFrom(self, direction):
"""Note the position/direction that we just came from."""
- return self.previous == (self.position[0]+direction[0], self.position[1]+direction[1])
+ return self.previous == (self.position[0] + direction[0], self.position[1] + direction[1])
def keepGoing(self, curdir, maze):
"""Try to keep going if the direction is obvious.
This prevents the player from having to use the arrows to navigate
every single twist and turn of large mazes."""
# possible directions are fwd, turn left, turn right
- directions = [curdir, (curdir[1],curdir[0]), (-curdir[1],-curdir[0])]
+ directions = [curdir, (curdir[1], curdir[0]), (- curdir[1], - curdir[0])]
# remove any that are blocked
for d in list(directions):
if not self.canGo(d, maze):
@@ -108,13 +111,13 @@ class Player:
if len(directions) == 1:
self.direction = directions[0]
else:
- self.direction = (0,0)
+ self.direction = (0, 0)
def bonusPlayers(self):
if self.bonusplayers is None:
self.bonusplayers = []
- self.bonusplayers.append(Player(self.buddy,'square'))
- self.bonusplayers.append(Player(self.buddy,'triangle'))
+ self.bonusplayers.append(Player(self.buddy, 'square'))
+ self.bonusplayers.append(Player(self.buddy, 'triangle'))
count = 2
for player in self.bonusplayers:
@@ -130,4 +133,3 @@ class Player:
for bonusplayer in self.bonusPlayers():
if bonusplayer.nick == nick:
return bonusplayer
-
diff --git a/po/Maze.pot b/po/Maze.pot
index 89ef7aa..5c66ad6 100755
--- a/po/Maze.pot
+++ b/po/Maze.pot
@@ -13,7 +13,7 @@ msgstr ""
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: activity/activity.info:2
diff --git a/po/es.po b/po/es.po
index 9462f4a..bc74f53 100755
--- a/po/es.po
+++ b/po/es.po
@@ -2,30 +2,7 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
#, fuzzy
msgid ""
msgstr ""
@@ -38,7 +15,6 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Translate Toolkit 1.6.0\n"
#: activity/activity.info:2
msgid "Maze"
diff --git a/Maze.activity/setup.py b/setup.py
index 6ed89aa..6ed89aa 100755
--- a/Maze.activity/setup.py
+++ b/setup.py