#Configure keybindings if ai == "1": cfg = ConfigLoader(bo, bo, configfile) elif ai == "2": cfg = ConfigLoader(bo, bo2, configfile) cfg.actions = {} elif ai == "3" or ai == "4": cfg = ConfigLoader(bo, bo, configfile) if opponent_ip == None: print("Opponent ip not specified") exit(1) if ai == "3": bo2.add_send_connection(opponent_ip) else: bo.draw_matrix(win.screen, str_to_matrix("please\nwait\nfor the\nsecond\nplayer"), [1*16*scale, 1*16*scale], bo.purple_block_image) pygame.display.flip() bo2.add_wait_connection(opponent_ip) bo.connection = bo2.connection bo.send_multi = True else: cfg = ConfigLoader(bo, bo2, configfile) #Load mod settings mods = ModLoader(bo, bo2, modfile) dt = 1.0/30.0 last_draw = time() curr_draw = 0.0
def draw_level(self, screen): mat = str_to_matrix(str(self.level)) pos = [self.bo_pos[0], self.bo_pos[1] + 16*(self.visible_height/2)*self.scale] self.draw_matrix(screen, mat, pos, self.blue_block_image)