Exemplo n.º 1
0
    def make_bomb_items(self, ret):
        bomb_obj_list = []

        #FIX THIS LINE OF CODE BELOW
        #IT SEEMS LIKE THE THE VARIABLE IS DECLARED NOT INSTANTIATED
        # this_variable_is_useless = agents.AggressiveAgent()
        this_variable_is_useless = agents.DummyAgent()
        for i in ret:
            bomb_obj_list.append(
                characters.Bomb(this_variable_is_useless, i['position'],
                                i['bomb_life'], i['blast_strength'],
                                i['moving_direction']))

        return bomb_obj_list
Exemplo n.º 2
0
 def convert_agents(self, board):
     ret = []
     for aid in range(10, 14):
         locations = np.where(board == aid)
         # agt = agents.AggressiveAgent()
         agt = agents.DummyAgent()
         agt.init_agent(aid, self._game_mode)
         if len(locations[0]) != 0:
             agt.set_start_position((locations[0][0], locations[1][0]))
         else:
             agt.set_start_position((0, 0))
             agt.is_alive = False
         agt.reset(is_alive=agt.is_alive)
         agt.agent_id = aid - 10
         ret.append(agt)
     return ret