def cloud_pattern(pattern_num): model = { 0 : 'MODEL 1', 1 : 'MODEL 2', 2 : 'MODEL 3', 3 : 'MODEL 4', 4 : 'MODEL 5', 5 : 'MODEL 6', 6 : 'MODEL 7', 7 : 'MODEL 8', 8 : 'MODEL 9', 9 : 'MODEL 10' } cloud_data_file = open('resource\\txt\\cloud_data.txt', 'r') cloud_data = json.load(cloud_data_file) cloud_data_file.close() clouds = [] for name in cloud_data[model[pattern_num]]: cloud = Cloud() cloud.name = name cloud.x = cloud_data[model[pattern_num]][name]['x'] cloud.y = cloud_data[model[pattern_num]][name]['y'] clouds.append(cloud) return clouds
def create_cloud(ai_settings, screen, clouds, cloud_number, row_number): cloud = Cloud(ai_settings, screen) cloud_width = cloud.rect.width cloud.x = cloud_width + 2 * cloud_width * cloud_number cloud.rect.x = cloud.x cloud.rect.y = cloud.rect.height + 2 * cloud.rect.height * row_number clouds.add(cloud)
def create_cloud(dino_settings, screen, clouds, cloud_num): cloud = Cloud(dino_settings, screen) cloud_width = cloud.rect.width cloud.x = cloud_width + 10 * cloud_width * cloud_num cloud.rect.x = cloud.x clouds.add(cloud)