(self, index=None)
| 2513 | self.load_set() |
| 2514 | |
| 2515 | def load_set(self, index=None): |
| 2516 | if type(index) == int: |
| 2517 | index = cfg.IMAGE_SETS[index] |
| 2518 | if index == None: |
| 2519 | index = random.choice(cfg.IMAGE_SETS) |
| 2520 | if hasattr(self, 'image_set_index') and index == self.image_set_index: |
| 2521 | return |
| 2522 | self.image_set_index = index |
| 2523 | self.image_set = [pyglet.sprite.Sprite(pyglet.image.load(path)) |
| 2524 | for path in resourcepaths['sprites'][index]] |
| 2525 | self.image_set_size = self.image_set[0].width |
| 2526 | |
| 2527 | def choose_random_images(self, number): |
| 2528 | self.image_indices = random.sample(range(len(self.image_set)), number) |
no outgoing calls
no test coverage detected