diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-05-24 15:47:27 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-05-24 15:47:27 (GMT) |
commit | e16e2fd614b942d727e14814efaf15640884dd65 (patch) | |
tree | 49c2d9855d68e5a403b9fba454c599be4f03d2fc | |
parent | 1ee0d96ecebe319e997f5ec64ebe2398fdffc2d3 (diff) |
calculate number of taunt cards rather than hardwiring
-rw-r--r-- | game.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -353,13 +353,14 @@ class Game(): return x, y def _taunt(self, x, y, i): - self._taunt_cards[(i + 1) % 4].hide() + n = len(self._taunt_cards) + self._taunt_cards[(i + 1) % n].hide() if self._clicked: self._timeout_id = None return True else: - self._taunt_cards[i % 4].move((x, y)) - self._taunt_cards[i % 4].set_layer(LOCO_LAYER) + self._taunt_cards[i % n].move((x, y)) + self._taunt_cards[i % n].set_layer(LOCO_LAYER) self._timeout_id = gobject.timeout_add( 200, self._taunt, x, y, i + 1) |