Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-04-20 16:11:41 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-04-20 16:11:41 (GMT)
commit17d792d8ded61f1309699f7bb396031b294a2182 (patch)
treeb4c80073ce0f1875ea751113a7f9c7589519e47a
parent880622e706520a7dbf20e36f695d290a2eed34e2 (diff)
add slight delay before dealing new cards.
-rw-r--r--game.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/game.py b/game.py
index 6a8ad8e..6327e42 100644
--- a/game.py
+++ b/game.py
@@ -707,12 +707,10 @@ class Game():
self.matches += 1
for c in self.clicked:
self.match_list.append(c.spr)
-
- # Deal three new cards.
- self.grid.replace(self.clicked, self.deck)
self._matches_on_display = True
- self.set_label('deck', '%d %s' %
- (self.deck.cards_remaining(), _('cards')))
+
+ # Wait a few seconds before dealing new cards.
+ gobject.timeout_add(2000, self._deal_new_cards)
# Test to see if the game is over.
if self._game_over():
@@ -745,6 +743,14 @@ class Game():
else:
self._matches_on_display = False
+ def _deal_new_cards(self):
+ ''' Deal three new cards. '''
+ self.grid.replace(self.clicked, self.deck)
+ self.set_label('deck', '%d %s' %
+ (self.deck.cards_remaining(), _('cards')))
+
+
+
def _keypress_cb(self, area, event):
''' Keypress: editing word cards or selecting cards to play '''
k = gtk.gdk.keyval_name(event.keyval)
@@ -943,11 +949,6 @@ class Game():
if robot_match:
# Before robot finds a match: restore any cards in match area
if self._matches_on_display:
- '''
- self.match_list[-1].hide()
- self.match_list[-2].hide()
- self.match_list[-3].hide()
- '''
# And unselect clicked cards
for c in self.clicked:
c.hide()