Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在pygame中制作游戏,我知道如何制作将在随机位置产生敌人的类,使其随机移动,并且玩家的攻击接近,但我不知道如何重用这个类无限次。如何创建任意数量的类实例?
创建类的实例并将其放入列表有什么问题?
entity_list = [] for i in range(10000000): entity_list.append(Entity())