import pygame

# Define the Player class
class Player(pygame.sprite.Sprite):
    def __init__(self):
        super().__init__()
        self.image = pygame.image.load("Player_Sprite_R.png")  # Make sure the image file exists
        self.rect = self.image.get_rect()

# Sample drawing a rectangle on a surface
surface = pygame.Surface((200, 200))  # Example surface, this should be the actual surface in your game
color = (255, 0, 0)  # Red color for the rectangle
pygame.draw.rect(surface, color, pygame.Rect(30, 30, 60, 60))

# Collision checks
object1 = pygame.Rect((20, 50), (50, 100))
object2 = pygame.Rect((10, 10), (100, 100))
object3 = pygame.Rect((0, 0), (50, 50))

print(object1.colliderect(object2))  # Check collision between object1 and object2
print(object1.colliderect(object3))  # Check collision between object1 and object3
print(object2.colliderect(object3))  # Check collision between object2 and object3

# Moving objects with move() and move_ip()
object1 = pygame.Rect((20, 50), (50, 100))
object2 = object1.move(100, 100)  # This returns a new Rect, object1 is unchanged
print(object1.topleft)  # Prints the original position of object1
print(object2.topleft)  # Prints the new position of object2

object1 = pygame.Rect((20, 50), (50, 100))
object1.move_ip(100, 100)  # This modifies object1 in-place
print(object1.topleft)  # Prints the new position of object1 after move_ip()

# Checking if a point is inside the rectangle
object1 = pygame.Rect((20, 50), (50, 100))
print(object1.collidepoint(50, 75))  # Check if the point (50, 75) is inside object1

# Checking collision with a list of rectangles
object1 = pygame.Rect((20, 50), (50, 100))
object2 = pygame.Rect((10, 10), (100, 100))
object3 = pygame.Rect((0, 0), (50, 50))
object4 = pygame.Rect((100, 100), (30, 50))

rect_list = [object4, object3, object2]
print(object1.collidelist(rect_list))  # Checks if object1 collides with any rect in rect_list

# Using update() to change position and size
object1 = pygame.Rect((20, 50), (50, 100))
object1.update((30, 30), (50, 50))  # This updates the position and size of object1
print(object1.topleft)  # Prints the updated position of object1
print(object1.size)     # Prints the updated size of object1