Exemple #1
0
 def generate_points(self):
     random.seed(self.random_seed)
     modes = get_all_pi_creature_modes()
     seed = PiCreature(mode=self.start_mode)
     seed.scale_to_fit_height(self.height)
     seed.to_edge(DOWN)
     creatures = [seed]
     self.add(VGroup(seed))
     for x in range(self.order):
         new_creatures = []
         for creature in creatures:
             for eye, vect in zip(creature.eyes, [LEFT, RIGHT]):
                 new_creature = PiCreature(mode=random.choice(modes))
                 new_creature.scale_to_fit_height(self.scale_val *
                                                  eye.get_height())
                 new_creature.next_to(eye, vect, buff=0, aligned_edge=DOWN)
                 new_creatures.append(new_creature)
             creature.look_at(random.choice(new_creatures))
         self.add_to_back(VGroup(*new_creatures))
         creatures = new_creatures
Exemple #2
0
 def generate_points(self):
     random.seed(self.random_seed)
     modes = get_all_pi_creature_modes()
     seed = PiCreature(mode = self.start_mode)
     seed.scale_to_fit_height(self.height)
     seed.to_edge(DOWN)
     creatures = [seed]
     self.add(seed)
     for x in range(self.order):
         new_creatures = []
         for creature in creatures:
             for eye in creature.eyes:
                 new_creature = PiCreature(
                     mode = random.choice(modes)
                 )
                 new_creature.replace(eye)
                 new_creature.scale(
                     self.scale_val,
                     about_point = new_creature.get_bottom()
                 )
                 new_creatures.append(new_creature)
             creature.blink()
         self.add_to_back(VGroup(*new_creatures))
         creatures = new_creatures