def _init_game(self): # self.board = AnchorLayout(anchor_x='center', anchor_y='center') self.board = Board(self) # , size_hint=(None, None), size=(int(350), int(350))) # self.board.add_widget(board) self.add_widget(self.board) self.help = TextInput( readonly=True, cursor_color=(0, 0, 0, 0), background_color=(0, 0, 0, 1), foreground_color=(1, 0, 0, 1), text=self.board.room.say()) w = Widget() b = Button() w.walk() self.settings = Settings(self.music) self.add_widget(self.help) self.add_widget(self.settings)
def __init__(self, first="USER"): super().__init__() self.resizable(False, False) self.watch = Watch(self) self.tally = Tally(self) self.board = Board(self) self.boxes = self.board.boxes abox = list(self.boxes.values())[0] self.boxwidth, self.boxheight = abox["width"], abox["height"] self.playerdict = {0: "USER", 1: "BOT", "USER": 0, "BOT": 1} self.turn = self.playerdict[first.upper()] self.symbols = [r"imgs\ticx.png", r"imgs\ticcircle.png"] self.array = np.full((3, 3), 2, dtype="uint8") self.switch()