def draw(self, window): x = self.pos[0] - self.half_len y = self.pos[1] + self.width p = coords((x, y)) w = dist(self.width) h = dist(self.half_len * 2) r = pygame.Rect(p, (h, w)) pygame.draw.rect(window, self.color, r) xy1 = (self.pos[0] - self.half_len, self.pos[1]) xy2 = (self.pos[0] + self.half_len, self.pos[1]) pygame.draw.line(window, (255, 255, 255), coords(xy1), coords(xy2), 2)
def draw(self, window): if self.__image is None: self.load_image() # Тут нарисуем наш шарик по-новому p = coords(self.pos) x = p[0] - self.__image.get_width() // 2 y = p[1] - self.__image.get_height() // 2 p = (x, y) window.blit(self.__image, p)
def draw(self, window): if self.__image is None: self.load_image() p = coords(self.pos) k = 1 im = self.current_image x = p[0] - im.get_width() // 2 y = p[1] - im.get_height() // 2 p = (x,y) window.blit(im, p)
def draw(self, window): if self.__image is None: self.load_image() p = coords(self.pos) a = degrees(self.angle) im = pygame.transform.rotate(self.__image, a) x = p[0] - im.get_width() // 2 y = p[1] - im.get_height() // 2 p = (x, y) window.blit(im, p)
def draw(self, window): xy1 = coords(self.pos) xy2 = coords(self.end) pygame.draw.line(window, self.__color, xy1, xy2, dist(self.__width))
def draw(self, window): win_pos = coords(self.__pos) win_rad = dist(self.__radius) pygame.draw.circle(window, self.__color, win_pos, win_rad)