Answer the question
In order to leave comments, you need to log in
How to display several figures on the display, get their coordinates and write the coordinates to an array, which can then be manipulated?
I only display 1 image. To display several, respectively, you need a cycle. But where to insert it so that the data can be controlled and the pictures are displayed on the new coordinates every time the coordinates change?
class figure(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(os.path.join(IMG,"figure.png")).convert()
self.image.set_colorkey(BLACK) # made bg transparent
self.rect = self.image.get_rect()
self.rect.x = 35
self.rect.y = 35
self.image = pygame.transform.scale(self.image, (70, 70))
all_sprites = pygame.sprite.Group()
figure= figure()
all_sprites.add(figure)
all_sprites.draw(screen)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question