Example #1
0
class MyInterface(gui.GameInterface):

    def piece_clicked(self, row, column, section, piece):
        piece.selected = not piece.selected
        print("{}, {} Section: {}".format(row, column, section))

    def reverse_clicked(self, clockwise):
        print(clockwise)
        gui.set_points(100)

    def piece_section_entered(self, section, piece):
        print("Section entered {}".format(section))

    def hint_asked(self):
        print("Para k kieres saber eso jaja saludos")

    def save_game(self):
        print("Save game")

gui.init()
gui.set_quality("ultra")  # low, medium, high ultra
gui.set_animations(False)
gui.set_scale(1)  # Any float different from 0
gui.set_game_interface(MyInterface())  # GUI Listener
gui.add_piece(0, 0, random.choice(variables.HEXAGON_TYPES))


gui.run()

Example #2
0
    # listo
    def guardar_juego(self):
        if self.hint == "":
            pass
        else:
            gui.pop_piece(int(self.hint[0]), int(self.hint[1]))
            self.hint = ""
        self.numeros += 1
        DATOS.guardados.agregar_nodo(DATOS.puestas.len)
        gui.add_number(self.numeros, self.color)

        print("Presionaron guardar")


if __name__ == 'demo':

    def hook(type, value, traceback):
        print(type)
        print(value)
        print(traceback)

    sys.__excepthook__ = hook

    gui.set_scale(False)  # Any float different from 0
    gui.init()
    gui.set_quality("ultra")  # low, medium, high ultra
    gui.set_animations(False)
    gui.init_grid()
    gui.set_game_interface(MyInterface())  # GUI Listener
    gui.run()
Example #3
0
        total = edd.Mylist()
        L_Pieces1 = edd.Mylist()
        L_Pieces = edd.Mylist()
        line = file.readline().split(',')
        for lines in file:
            linea = lines.strip('\n')
            linea = linea.split(',')
            total.agregar(linea)
        for t, c in total:
            p = Pieza(t, int(c))
            L_Pieces.agregar(p)
            L_Pieces1.agregar(p)

    jugador = namedtuple('Jugador', ['puntaje', 'color'])

    def hook(type, value, traceback):
        print(type)
        print(value)
        print(traceback)

    sys.__excepthook__ = hook

    gui.set_scale(False)  # Any float different from 0
    gui.init()
    pieza = gui.__game
    gui.set_quality("ultra")  # low, medium, high ultra
    gui.set_animations(False)
    gui.init_grid()
    gui.set_game_interface(MyInterface())
    gui.run()