Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dominoactivity.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/dominoactivity.py b/dominoactivity.py
index c84da86..166c4e7 100644
--- a/dominoactivity.py
+++ b/dominoactivity.py
@@ -218,13 +218,18 @@ class Domino(activity.Activity):
y = int(event.get_coords()[2])
if self.game.game_state == DominoGame.GAME_STATE_SELECT_PIECE:
- for player in self.game.players:
- i = 0
- for piece in player.get_pieces():
- if piece.visible and piece.check_touched(x, y):
- player.order_piece_selected = i
- self.drawingarea.queue_draw()
- i += 1
+ player = self.game.ui_player
+ i = 0
+ for piece in player.get_pieces():
+ if piece.visible and piece.check_touched(x, y):
+ player.order_piece_selected = i
+
+ if player.place_piece(piece):
+ player.end_play()
+ self.draw_pieces()
+
+ self.drawingarea.queue_draw()
+ i += 1
def draw_pieces(self):
self.surface = cairo.ImageSurface(