# Importing the Pygame library for building games and multimedia applications. import pygame # Importing constants from pygame.locals module. from pygame.locals import * # Importing the sys module to exit the program. import sys # Initializing all Pygame modules. pygame.init() # Defining a class for the player sprite. class Player(pygame.sprite.Sprite): # Constructor method that runs when a new instance of the class is created. def __init__(self): # Calling the constructor of the superclass (pygame.sprite.Sprite). super().__init__() # Loading the player sprite image from a file ("Player_Sprite_R.png"). self.image = pygame.image.load("Player_Sprite_R.png") # Getting the rectangle that encloses the player sprite image. self.rect = self.image.get_rect()