Пример #1
0
    def __init__(self, parent, *args, **kwargs):
        super().__init__(parent, *args, **kwargs)
        self.parent = parent
        self.parent.title("TIC TAC TOE")
        self.width = 400
        self.height = 300
        self.tablero = TicTacToe()  #variable para tablero
        self.parent.config(cursor='arrow')
        self.x_cordinate = int((self.parent.winfo_screenwidth() / 2) -
                               (self.width / 2))
        self.y_cordinate = int((self.parent.winfo_screenheight() / 2) -
                               (self.height / 2))
        self.parent.geometry(
            '%dx%d+%d+%d' %
            (self.width, self.height, self.x_cordinate, self.y_cordinate))
        self.parent.resizable(False, False)
        self.parent.configure(background='beige')

        self.FrameCentral = tk.Frame(master=self.parent,
                                     width=self.width,
                                     height=self.height,
                                     bg='beige')
        self.FrameCentral.grid_propagate(0)
        self.FrameCentral.config(cursor='arrow')
        self.FrameCentral.place(x=0, y=0)
        self.principal()
Пример #2
0
    def __init__(self, size):
        self.size = size
        self.game = TicTacToe(size)
        self.root = self.create_root_window()
        self.grid = self.create_grid()

        b = Button(self.root, text=":)", command=self.on_click_new_game)
        b.grid(row=self.size, column=1)
Пример #3
0
 def __init__(self):
     self.surface = WINDOW
     self.width = WIDTH
     self.height = HEIGHT
     self.rows = 3
     self.color = colors['white']
     self.game = TicTacToe()
     self.winner = None
     self.font = 'century gothic'
     self.font_name = pygame.font.match_font(self.font, 1)
Пример #4
0
 def reset(self):
     del self.game
     self.game = TicTacToe()