import pygame,sys class Player(pygame.sprite.Sprite): def _init_(self, pos_x, pos_y): super()._init_() self.image = pygame.Surface([20,20]) self.image.fill((255,255,255)) self.rect = self.image.get_rect() self.rect.topleft = [pos_x,pos_y] # general setup pygame.init() clock = pygame.time.Clock() #game screen screen_width = 400 screen_height = 400 screen = pygame.display.set_mode((screen_width,screen_height)) pygame.display.set_caption("Sprite Animation") #creating the sprites and groups moving_sprites = pygame.sprite.Group()