Exemplo n.º 1
0
 def step(self):
     self.offset += 1
     x = 0
     colors = [
         interpolate([purple, white], len(self.state.positions[0]),
                     self.offset),
         interpolate([orange, red], len(self.state.positions[1]),
                     self.offset),
         interpolate([green, blue], len(self.state.positions[2]),
                     self.offset),
         interpolate([red, orange], len(self.state.positions[3]),
                     self.offset),
     ]
     for x, row in enumerate(colors):
         for y, c in enumerate(row):
             self.state[x, y] = c
Exemplo n.º 2
0
    def __init__(self, checker, position, player):
        self.checker = checker
        to_x, to_y = PIECE_POSITIONS[position]
        to = to_x, to_y

        checker.can_drag = False
        checker.rect.x = to_x


        self.moves = common.interpolate(checker.rect.topleft, to)
Exemplo n.º 3
0
    def __init__(self):
        Sprite.__init__(self)
        self.base_image = common.load_image('turn.png')
        self.can_drag = False
        self.can_click = False

        self.font = pygame.font.Font("font/DejaVuSans.ttf", 17)
        self.update = self.update_starting
        self.movement = common.interpolate((445, 600), (445, 45))
        self.image = self.base_image.copy()
        self.rect = self.image.get_rect()
Exemplo n.º 4
0
 def __init__(self, checker, to_x, to_y):
     self.checker = checker
     to = to_x, to_y
     self.moves = common.interpolate(checker.rect.topleft, to)
     self.checker.can_drag = False