Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/grid.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-03-06 15:19:29 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-03-06 15:19:29 (GMT)
commitdf5fa81b616dd785b01e01eaec97074555fba17b (patch)
tree1664ce8f744788e846568cea7f508af65c9bb9d2 /grid.py
parent10443715a592b8491a65a5cac63d9d498a28eab0 (diff)
added save/restore and highlight of active tile
Diffstat (limited to 'grid.py')
-rw-r--r--grid.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/grid.py b/grid.py
index abf08d7..6de9a8b 100644
--- a/grid.py
+++ b/grid.py
@@ -13,6 +13,7 @@
import gtk
from deck import Deck
+from card import blank_card
ROW = 8
COL = 8
@@ -21,9 +22,10 @@ COL = 8
class Grid:
''' Class for managing ROWxCOL matrix of cards '''
- def __init__(self, width, height, card_width, card_height):
+ def __init__(self, sprites, width, height, card_width, card_height, scale):
# the playing surface
self.grid = []
+ self.blanks = []
# the tiles in your hand
self.hand = []
@@ -41,6 +43,10 @@ class Grid:
self.top = 0
self.yinc = int(card_height)
+ for i in range(ROW * COL):
+ self.blanks.append(blank_card(sprites, scale))
+ self.blanks[i].move(self.grid_to_xy(i))
+
def deal(self, deck):
''' Deal an initial set of cards to the hand '''
for i in range(COL):