(self)
| 886 | self.world.on_tick(lambda timestamp: ModuleWorld.on_world_tick(weak_self, timestamp)) |
| 887 | |
| 888 | def select_hero_actor(self): |
| 889 | hero_vehicles = [actor for actor in self.world.get_actors( |
| 890 | ) if 'vehicle' in actor.type_id and actor.attributes['role_name'] == 'hero'] |
| 891 | if len(hero_vehicles) > 0: |
| 892 | self.hero_actor = random.choice(hero_vehicles) |
| 893 | self.hero_transform = self.hero_actor.get_transform() |
| 894 | else: |
| 895 | self._spawn_hero() |
| 896 | |
| 897 | def _spawn_hero(self): |
| 898 | # Get a random blueprint. |
no test coverage detected