-3
私はゲームを作ろうとしていますが、私は働く世界の負荷を得ることができません 誓いは偽りではない varの更新はしばらくループ エラーは、ブロックがピックアップして表示される領域にあります。エラー: "タイプオブジェクト 'world_load'に属性 'split'がありません"
class world_load:
def __init__(self, line):
self.type = line[0]
self.x = line[1]
self.y = line[2]
def __str__(self):
return self.type+" "+self.x+" "+self.y
with open(fillName, encoding=encoding) as file:
file.readline()
for line in file.readlines():
line = line.strip()
line = line.split(" ")
w = world_load(line)
world.append(p)
while update:
#input
for event in pygame.event.get():
if event.type == pygame.QUIT:
update = False
dis.fill(sky)
for world_load in world:
wo = world_load.split(" ")
if wo[0] == block_grass:
block_grass(wo[1],wo[2])
WOSない穴コード 聞くがエラーFINGあります:あなたが悪い文法やスペルを使用しているので、
Traceback (most recent call last):
File "C:\Users\Deltagare\Desktop\program\Game\Game.py", line 68, in <module>
wo = world_load.split(" ")
AttributeError: type object 'world_load' has no attribute 'split'