From 17d792d8ded61f1309699f7bb396031b294a2182 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 20 Apr 2012 16:11:41 +0000 Subject: add slight delay before dealing new cards. --- 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() -- cgit v0.9.1