0

My problem:

So I am programing a game right now and I am at the start of it. So I just wanted to draw a sprite on my screen which is called in an other Filer but I always get the error that the line 13 repeated 491 times more.

This is the code:

import pygame
  

class Start(pygame.sprite.Sprite):

    def __init__(self,surface):
        super().__init__()
        self.display_surface = surface
        self.image = pygame.image.load("Pygame-Graphics/Start.png").convert_alpha()
        self.rect = self.image.get_rect(topleft = (500,400))
        self.start = pygame.sprite.GroupSingle()

        self_sprite = Start(self.rect)
        self.start.add(self_sprite)

    def draw(self):
        self.start.update()
        self.start.draw(self.display_surface)

So i except, that when i call the function draw from an other file that my sprite is being drawn on my screen.

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
  • A `pygame.sprite.Sprite` dos not need a `draw` method. See [How can I add objects to a "pygame.sprite.Group()"?](https://stackoverflow.com/questions/73924256/how-can-i-add-objects-to-a-pygame-sprite-group) and [What does pygame.sprite.Group() do](https://stackoverflow.com/questions/68765971/what-does-pygame-sprite-group-do) – Rabbid76 Jan 10 '23 at 08:50

0 Answers0