Changing camera perspective in pygame

I am writing a little game with pygame. I want to add four different camera perspectives to be able to look at the screen from four sides. The first camera perspective is working perfectly fine (player in center and dungeon moving along). However, in the second perspective, the player does not stay on the same spot. I did add the other perspectives, but did not work on them just yet, so I will only give the relevant code to the first and second perspective.

WIDTH, HEIGHT = 1000, 600
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))

#Debug-Screen
pygame.font.init()
FONT = pygame.font.SysFont('comicsans',20)

core_diameter = 32
parcel_size = 64

PLAYER = pygame.transform.scale(pygame.image.load("assets/blob.png"),(core_diameter,core_diameter))
GROUND_PARCEL = pygame.transform.scale(pygame.image.load("assets/stone.png"),(parcel_size,parcel_size))

#creating the statics of the dungeon
DUNGEON_WIDTH, DUNGEON_HEIGHT = 20, 20 #Number of tetures, essentially m²

def draw_window(core, xpos, ypos, cam_perspective):
    WINDOW.fill((0,0,0))
        
    #Here the floor display begins...
    #cam_perspective 1 working totally fine!    
    if cam_perspective == 1:     
        x_tot = int(WIDTH // parcel_size + 2) #window
        y_tot = int(HEIGHT // parcel_size + 2) 
        x = xpos - WIDTH/(2*parcel_size) #bitmap position at window edge (top left)
        y = ypos - HEIGHT/(2*parcel_size) 
        x_start = int(int(x) * parcel_size - x * parcel_size) #window position of generation start
        y_start = int(int(y) * parcel_size - y * parcel_size)
                      
        #Some Code to display the floor always correctly, else it bugs. 
        hinder_gen_bug_y = False 
        for i in range(y_tot):
            if not hinder_gen_bug_y:
                grid_y = int(i + y) #current bitmap y pos
            elif grid_y != -1:
                grid_y = int(i + y + 1)
            if grid_y == 0 and y != int(y) and y < 0: 
                hinder_gen_bug_y = True
            hinder_gen_bug_x = False
            for j in range(x_tot):
                if not hinder_gen_bug_x:
                    grid_x = int(j + x) #current bitmap x pos
                elif grid_x != -1:
                    grid_x = int(j + x + 1)
                if grid_x == 0 and x != int(x) and x < 0: 
                    hinder_gen_bug_x = True
                    
                #...and the display
                if 0 <= grid_y < DUNGEON_HEIGHT and 0 <= grid_x < DUNGEON_WIDTH: #if in dungeon
                    if DUNGEON_FLOOR[grid_y][grid_x] == 1: #bitmap
                        WINDOW.blit(GROUND_PARCEL, (x_start + j * parcel_size, y_start + i * parcel_size)) #window
                    
    if cam_perspective == 2:    
        x_tot = int(WIDTH//parcel_size+2)
        y_tot = int(HEIGHT//parcel_size+2)
        x_edge_coords = xpos + WIDTH/(2*parcel_size) #Hier was ändern
        y_edge_coords = ypos - HEIGHT/(2*parcel_size) #Hier was ändern
        x_start_square = math.ceil(x_edge_coords)
        x_start_display_pos = -(x_start_square-x_edge_coords)*parcel_size
        y_start_square = int(y_edge_coords)
        y_start_display_pos = -(y_edge_coords-y_start_square)*parcel_size
        for i in range(y_tot):
            for j in range(x_tot):
                if 0 <= x_start_square-j < DUNGEON_WIDTH and 0 <= y_start_square+i < DUNGEON_HEIGHT: #if in dungeon
                    if DUNGEON_FLOOR[x_start_square-j][y_start_square+i] == 1: #bitmap
                        WINDOW.blit(GROUND_PARCEL, (x_start_display_pos + j * parcel_size, y_start_display_pos + i * parcel_size)) #window

    WINDOW.blit(PLAYER, (core.x, core.y))
    coords = FONT.render("X:" + str(int(xpos)) + " | Y:" + str(int(ypos)), 1, (255, 0, 0))
    cam = FONT.render("Cam Perspective: " + str(cam_perspective), 1, (255, 0, 0))
    WINDOW.blit(coords, (0, 0))
    WINDOW.blit(cam, (0, 24))
    pygame.display.update()

The variables given to the function are just the coordinates of the player as well as the cam perspective.

I tried to solve the problem by just copying the code for cam perspective 1 and adjusting it a little bit, but that did not work. I also tried adjusting the x_tot/y_tot as well as x_edge_coords/y_edge_coords, but that didnt solve the issue, it just made zooming in and out near impossible.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật