Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Minor <j@lux.vu>2007-12-12 06:09:38 (GMT)
committer Joshua Minor <j@lux.vu>2007-12-12 06:09:38 (GMT)
commit5a89304c04d4702d5cbeb20b605a49643568aec5 (patch)
tree2ffd8038ccdc4d17382f6aa4ad719bf79a9a982f
parent129923b8262206e4b0f1825745975d3ff2b6b603 (diff)
Added Brendan's icon.
Fixed timing by using pygame.time.Clock()
-rw-r--r--Maze.activity/activity/activity-maze.svg22
-rw-r--r--Maze.activity/game.py7
-rw-r--r--Maze.activity/player.py2
3 files changed, 19 insertions, 12 deletions
diff --git a/Maze.activity/activity/activity-maze.svg b/Maze.activity/activity/activity-maze.svg
index 2ae37bd..23558f4 100644
--- a/Maze.activity/activity/activity-maze.svg
+++ b/Maze.activity/activity/activity-maze.svg
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
- <!ENTITY fill_color "#FFFFFF">
- <!ENTITY stroke_color "#000000">
-]>
-<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50">
- <rect x="1" y="1" width="48" height="48"
- style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:2"/>
-</svg>
-
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY fill_color "#000000">
+ <!ENTITY stroke_color "#FFFFFF">
+]>
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="50px" height="50px" viewBox="0 0 50 50" enable-background="new 0 0 50 50" xml:space="preserve">
+<path style="fill:&fill_color;;stroke:&stroke_color;;stroke-width:3.5" d="M49,25H24.497v10.188H12.749L12.75,43H7.001V30H18.75V19.5H31V7.25h12
+ v6.25h-6v6h12L49.001,1H49H25v0.002V13.5h-6.25V1H1v6h11.75v17H7.001V12.75h-6L1,43v6h17.749v-7.812h5.749L24.497,49h0.001v0.001
+ L37.562,49v-6h-7.064l-0.002-12h12.505l0.001,18.001h6L49,25z"/>
+</svg>
diff --git a/Maze.activity/game.py b/Maze.activity/game.py
index 07e596f..813ce33 100644
--- a/Maze.activity/game.py
+++ b/Maze.activity/game.py
@@ -3,6 +3,8 @@
# Maze.activity
# A simple multi-player maze game for the XO laptop.
#
+# Special thanks to Brendan Donohoe for the icon.
+#
# Copyright (C) 2007 Joshua Minor
#
# This program is free software; you can redistribute it and/or modify
@@ -217,6 +219,7 @@ class MazeGame:
# lets draw once before we enter the event loop
self.draw()
pygame.display.flip()
+ clock = pygame.time.Clock()
while self.running:
# is there anything to animate?
@@ -237,7 +240,9 @@ class MazeGame:
self.draw()
pygame.display.flip()
- pygame.time.wait(1000/24)
+ # don't animate faster than 12 frames per second
+ # this keeps the speed reasonable and limits cpu usage
+ clock.tick(12)
def harder(self):
"""Make a new maze that is harder than the current one."""
diff --git a/Maze.activity/player.py b/Maze.activity/player.py
index de7fee7..0c55fc0 100644
--- a/Maze.activity/player.py
+++ b/Maze.activity/player.py
@@ -1,3 +1,5 @@
+from sugar.graphics.icon import Icon
+from sugar.graphics.xocolor import XoColor
class Player:
def __init__(self, buddy):