def get_center_wall(ai_settings, screen): """Returns a wall with it's centerx and centery equal to that of the screen's.""" screen_rect = screen.get_rect() center_wall = Wall(ai_settings, screen) center_wall.centerx = screen_rect.centerx center_wall.centery = screen_rect.centery return center_wall
def create_wall(ai_settings, screen, walls, center_wall, column_number, row_number): """Specify the correct coordinates for the individual walls to spawn and Adds the new wall into the list(walls).""" new_wall = Wall(ai_settings, screen) new_wall.centerx = wall_get_x(ai_settings, new_wall.rect, column_number, center_wall) new_wall.centery = wall_get_y(ai_settings, new_wall.rect, row_number, center_wall) walls.add(new_wall)