Пример #1
0
class NormalGame(Screen):

    def __init__(self, window):
        super(NormalGame, self).__init__(window)
        self.surface = pygame.Surface(window.size)
        x = self.window.width - self.window.height / 2 - 10
        y = self.window.center[1]
        self.board = Board(x, y, window.height - 20, window.height - 20)
        self.board.start(self)

    @property
    def frame(self):
        self.surface.fill((200, 255, 255))
        self.put_widget(self.board)
        return self.surface
Пример #2
0
 def __init__(self, window):
     super(NormalGame, self).__init__(window)
     self.surface = pygame.Surface(window.size)
     x = self.window.width - self.window.height / 2 - 10
     y = self.window.center[1]
     self.board = Board(x, y, window.height - 20, window.height - 20)
     self.board.start(self)
Пример #3
0
 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)
Пример #4
0
    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()