Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/card.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-09-10 00:34:49 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-09-10 00:34:49 (GMT)
commit6a817aa19ffe517a760a771e734a0ddea894c64a (patch)
treebdba92e2f3f654e0bf5717c0600916ccce158b6f /card.py
parent6577efe934883d82f67b121b5b273ba51904f2f5 (diff)
added hexagon game
Diffstat (limited to 'card.py')
-rw-r--r--card.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/card.py b/card.py
index a408ab1..4c5d5b2 100644
--- a/card.py
+++ b/card.py
@@ -29,13 +29,16 @@ class Card:
""" Load a card from a precomputed SVG. """
self.images = []
self.orientation = 0
- self.increment = 90
if shape == 'triangle':
file = "%s/triangle-r0-%d.svg" % (path, c)
self.increment = 60
+ elif shape == 'hexagon':
+ file = "%s/hexagon-r0-%d.svg" % (path, c)
+ self.increment = 120
else:
file = "%s/card-%d.svg" % (path, c)
+ self.increment = 90
self.images.append(load_image(file, card_dim * scale,
card_dim * scale))
@@ -56,6 +59,13 @@ class Card:
file = "%s/triangle-r300-%d.svg" % (path, c)
self.images.append(load_image(file, card_dim * scale,
card_dim * scale))
+ elif shape == 'hexagon':
+ file = "%s/hexagon-r120-%d.svg" % (path, c)
+ self.images.append(load_image(file, card_dim * scale,
+ card_dim * scale))
+ file = "%s/hexagon-r240-%d.svg" % (path, c)
+ self.images.append(load_image(file, card_dim * scale,
+ card_dim * scale))
else:
for r in range(3):
self.images.append(self.images[r].rotate_simple(90))