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@walter-laptop.(none)>2009-10-07 16:24:43 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-10-07 16:24:43 (GMT)
commita10a5ffb402543560a6bf040b9f1149751a48e78 (patch)
tree91dc2c9565be4c1b5b34fdb1c11caee8110127fc /card.py
parenta86ece87b3b15f34be38179abb0e17085d178660 (diff)
adding rotation sets
Diffstat (limited to 'card.py')
-rw-r--r--card.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/card.py b/card.py
index e20d374..22ed848 100644
--- a/card.py
+++ b/card.py
@@ -39,7 +39,7 @@ class Card:
self.east = c[1]
self.south = c[2]
self.west = c[3]
- self.rotate = 0
+ self.orientation = 0
# create sprite from svg file
self.spr = sprNew(tw, x, y,\
self.load_image(tw.path,i,tw.card_dim*tw.scale))
@@ -57,6 +57,10 @@ class Card:
'.svg'), \
int(wh), int(wh))
+ def set_orientation(self,r):
+ while r != self.orientation:
+ self.rotate_ccw()
+
def rotate_ccw(self):
# print "rotating card " + str(self.spr.label)
tmp = self.north
@@ -64,9 +68,9 @@ class Card:
self.east = self.south
self.south = self.west
self.west = tmp
- self.rotate += 90
- if self.rotate > 359:
- self.rotate -= 360
+ self.orientation += 90
+ if self.orientation > 359:
+ self.orientation -= 360
tmp = self.spr.image.rotate_simple(90)
self.spr.image = tmp