From 25fa63fc55f08f122928eefe42928fa0e21b93f1 Mon Sep 17 00:00:00 2001 From: Roberto Cristaldo Date: Tue, 29 Jan 2013 01:39:23 +0000 Subject: Backend working. Front End Fixed. TODO: Agregar la logica de juego (triunfo/derrota --- diff --git a/Ejemplo.py b/Ejemplo.py index d112ff5..29f899b 100755 --- a/Ejemplo.py +++ b/Ejemplo.py @@ -51,7 +51,7 @@ def main(): print 'Lugar relativo %s' %place_word speech_to_say = 'Donde esta la ' - if relative_place == False: + if place_word == False: speech_to_say += '' else: speech_to_say += place_word diff --git a/activity.py b/activity.py index e147d46..5a86c25 100644 --- a/activity.py +++ b/activity.py @@ -128,16 +128,14 @@ class ElephantActivity(activity.Activity): hbox_03.add(button_option3) # Connections - button_repeat.connect('clicked', self.__button_clicked_cb, \ - word, \ - choice_letter.letter, \ - choice_letter.relative_place, \ + button_repeat.connect('clicked', self.__button_clicked, \ + word, \ + choice_letter.letter, \ choice_letter.place_word) - label_word.connect('focus', self.__label_focus_cb, \ - word, \ - choice_letter.letter, \ - choice_letter.relative_place, \ + label_word.connect('focus', self.__label_focus, \ + word, \ + choice_letter.letter, \ choice_letter.place_word) options_places = choice_letter.random_places @@ -189,37 +187,32 @@ class ElephantActivity(activity.Activity): return label # Say the word and riddle on button click - def __button_clicked_cb(self, button, \ - word, \ - letter_to_say, \ - relative_place, \ - place_word): + def __button_clicked(self, button, \ + word, \ + letter_to_say, \ + place_word): self.speech_to_say(word, \ letter_to_say, \ - relative_place, \ place_word) # Say the word and riddle on label focus - def __label_focus_cb(self, label, \ + def __label_focus(self, label, \ word, \ letter_to_say, \ - relative_place, \ place_word): self.speech_to_say(word, \ letter_to_say, \ - relative_place, \ place_word) # Say the word and riddle def speech_to_say (self, word, \ letter_to_say, \ - relative_place, \ place_word): speech_to_say = 'Donde esta la ' - if relative_place == False: + if place_word == False: speech_to_say += '' else: speech_to_say += place_word diff --git a/elephant.py b/elephant.py index 28aed27..8254908 100755 --- a/elephant.py +++ b/elephant.py @@ -118,7 +118,7 @@ class letters: def _get_relative_place(self, letter_index, true_indexes): if len(true_indexes) == 1: - return False + return 999 relative_place = true_indexes.index(letter_index) @@ -128,7 +128,7 @@ class letters: # Translate relative place to words def _translate_to_str(self, relative_place): - if relative_place == False: + if relative_place == 999: return False places = ['Primera', \ -- cgit v0.9.1