I'm trying to draw a sprite from a png, the png is in the doomman folder. The error I'm getting is:
TypeError: add_internal() missing 1 required positional argument: 'group'
I'm new to drawing sprites in pygame. What's going on here?
Here's the code
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480))
BLACK = (0, 0, 0)
WHITE = (255,255,255)
RED = (255,0,0)
class Sprite(pygame.sprite.Sprite):
def __init__(self, pos):
# Don't forget to call the __init__ method of the parent class.
super(Sprite, self).__init__()
self.image = pygame.image.load(demon)
all_sprites_list = pygame.sprite.Group()
all_sprites_list.add(Sprite)
demon = pygame.image.load("C:/programming/doomman/cacodemon.png").convert_alpha()
clock = pygame.time.Clock()
pygame.display.set_caption("Demon Dance")
carryOn = True
while carryOn == True:
for event in pygame.event.get():
if event.type==pygame.QUIT:
carryOn=False
all_sprites_list.update()
pygame.display.flip()
clock.tick(60)
all_sprites_list.draw(screen)