Collision detection against player and blocks in the map
问题 I made a game map like this class Game_map: def __init__(self): self.land = pygame.image.load(r"C:\Users\name\OneDrive\Documents\A level python codes\final game\land.png").convert() self.height = 200 self.width = 200 self.land = pygame.transform.scale(self.land, (420, 250)) self.land.set_colorkey((0, 0, 0)) self.map_width = 6000 self.map_height = 2000 # 0 = emepty # 1 = land self.layout = [[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0 ], [ 0, 0