Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofert97@gmail.com>2013-10-19 18:43:21 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2013-10-19 18:43:21 (GMT)
commitdcc258823b75b62d59034a02e8c607e42c9b0680 (patch)
tree38a1790438a2da27435c8e51baa85b25f2b21b03
parentda77631ed7bbad8d4179aa41984ca64a023387df (diff)
Fixing bugsHEADmaster
Signed-off-by: Cristhofer Travieso <cristhofert97@gmail.com>
-rw-r--r--game.py25
-rwxr-xr-x[-rw-r--r--]window.py0
2 files changed, 13 insertions, 12 deletions
diff --git a/game.py b/game.py
index b31d08e..90018ec 100644
--- a/game.py
+++ b/game.py
@@ -25,10 +25,6 @@ import random
WIDTH = 1200
HEIGHT = 700
-OPPONENT_CARDS = [None, None, None]
-MY_CARDS = [None, None, None]
-CARDS = []
-
class Eventbox(Gtk.EventBox):
def __init__(self):
Gtk.EventBox.__init__(self)
@@ -119,14 +115,19 @@ class Box(Gtk.VBox):
self.opponent_box.pack_start(card3, True, True, 0)
def _click(self, widget):
+ children = self.play_box.get_children()
+ if len(children) > 2:
+ self.play_box.remove(children[-1])
+ self.play_box.remove(children[-2])
+
self.my_box.remove(widget)
self.play_box.pack_start(widget, True, False, 0)
-if __name__ == "__main__":
- window = Gtk.Window()
- window.connect('destroy', lambda w: Gtk.main_quit())
- window.add(Eventbox())
- window.maximize()
- window.set_title('Truco')
- window.show()
- Gtk.main()
+ self.opponent_box.remove(random.choice(self.opponent_box.get_children()))
+
+ img = Gtk.Image()
+ c = random.choice(self.cards[3: 5])
+ img.set_from_file('icons/cards/' + c + '.svg')
+ self.play_box.pack_start(img, True, False, 0)
+ img.show()
+
diff --git a/window.py b/window.py
index c7a1c64..c7a1c64 100644..100755
--- a/window.py
+++ b/window.py