[PATCH] Fixing tile.py to reset images, etc.

Christopher Schmidt crschmidt at metacarta.com
Mon Aug 20 11:53:45 EDT 2007


---

 tile.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

0302d76471056dab53fa0278ceee04d85461bd71
diff --git a/tile.py b/tile.py
index da05bbd..9a77138 100644
--- a/tile.py
+++ b/tile.py
@@ -65,10 +65,8 @@ class Tile(object):
         """set the answer"""
         self.answer = answer
         self.font = font
-        self.image_name = image_name
-        self.image = None
-        if image_name:
-            self.answer = image_name
+        if not image_name: self.image_name = None
+        if image_name and self.image_name != image_name:
             self.image_name = image_name
             self.image = load_image(self.image_name,1)
             scale_x = float(self.width )/float(self.image.get_rect().width)
@@ -80,6 +78,8 @@ class Tile(object):
         
         
     def get_answer(self):
+        if self.image_name:
+            return self.image_name
         return self.answer
     
     def get_rect(self):
-- 
1.2.4


--DocE+STaALJfprDB--


More information about the Games mailing list