Ejemplo n.º 1
0
    def promotion_message(self, color):
        if color == self.BLACK:
            color = 0
        else:
            color = 1

        knight = Knight(color)
        bishop = Bishop(color)
        rook = Rook(color)
        queen = Queen(color)

        tenth = self.size / 10
        pygame.draw.rect(
            self.screen, self.WHITE,
            [tenth, tenth, 8 * tenth, 2 * tenth])  # draw outer background
        pygame.draw.rect(self.screen, self.BLACK,
                         [tenth, tenth, 8 * tenth, 2 * tenth],
                         5)  # draw outer background

        knight.draw(self.screen, 1.5 * tenth, 1.5 * tenth, tenth)
        pygame.draw.rect(self.screen, self.BLACK,
                         [1.5 * tenth, 1.5 * tenth, tenth, tenth], 3)

        bishop.draw(self.screen, 3.5 * tenth, 1.5 * tenth, tenth)
        pygame.draw.rect(self.screen, self.BLACK,
                         [3.5 * tenth, 1.5 * tenth, tenth, tenth], 3)

        rook.draw(self.screen, 5.5 * tenth, 1.5 * tenth, tenth)
        pygame.draw.rect(self.screen, self.BLACK,
                         [5.5 * tenth, 1.5 * tenth, tenth, tenth], 3)

        queen.draw(self.screen, 7.5 * tenth, 1.5 * tenth, tenth)
        pygame.draw.rect(self.screen, self.BLACK,
                         [7.5 * tenth, 1.5 * tenth, tenth, tenth], 3)