def __init__(self, *args, **kwargs): if not Game.started: Game.first_registered_entity = self Game.start_game() else: Game.entity_register(self) self._collision_rectangle_calculated_corners = {'ul' : (0.0, 0.0), 'ur' : (0.0, 0.0), 'll' : (0.0, 0.0), 'lr' : (0.0, 0.0)} self._state_list = {} self._state_generators = {} self.add_state(self.execute, *args, **kwargs) Game.remember_current_entity_executing.append(Game.current_entity_executing) Game.current_entity_executing = self self._executing = True self._iterate_generator() Game.current_entity_executing = Game.remember_current_entity_executing.pop() for x in self._module_list: x._module_setup(self) if not Game.started: Game.started = True Game.run_game()