Exemplo n.º 1
0
    def evolution_operation(self):
        for i in range(len(self.enemies)):
            self.enemies[i].update(self.camera_move)
            if self.enemies[i].position[0] + self.enemies[i].size < 1500:
                self.enemies[i].position = [
                    2000 + i * 300 + random.randrange(0, 500) +
                    self.camera_move[0],
                    random.randrange(self.floor, self.ceiling)
                ]
                self.enemies[i].size = random.randint(20, 150)

        for i in range(len(self.character)):
            self.character[i].epoch_done()

        Scene_car.alive.append(Character_beast.how_many_alive())
        if len(Scene_car.alive) > 20: Scene_car.alive.pop(0)

        Character_beast.calculate_end_epoch_custom()
Exemplo n.º 2
0
    def init_character(self):
        super(Scene_car, self).init_character()
        self.ball_number_of_parts = config.START_POPULATION
        self.ball_position_default = config.CAR_BALL_POSITION_DEFAULT

        self.character = []
        for i in range(self.ball_number_of_parts):
            self.character.append(
                Character_beast(person=Beast(
                    [
                        self.ball_position_default[0],
                        self.ball_position_default[1]
                    ],
                    self.floor,
                    self.ceiling,
                )))
        self.number_of_life = 0
Exemplo n.º 3
0
 def __update_beast(self):
     for i in range(len(self.character)):
         self.character[i].update(self.camera_move, self.lazer_of_death,
                                  self.enemies)
     self.number_of_life = Character_beast.how_many_alive()
Exemplo n.º 4
0
 def exit_iteration(self):
     super().exit_iteration()
     self.number_of_life = Character_beast.how_many_alive()
     if self.number_of_life < 1:
         self.run_iteration = False