嘿,我一直在做一个迷宫游戏,我写了一个函数让角色(机器人)移动。问题是Python说我的函数不是define
NameError: name 'move' is not defined
但是我定义了它,并在主文件中导入了函数文件。 这是我的函数文件(经过修改,所以有点干净)
import pickle
from classes.labyrinthe import *
from roboc import *
from carte import *
from creer_labyrinthe import *
def move(oldLab, direction, steps):
global isOnExit
...
return oldLab
这是我的主文件(再次修改…)
import os
from classes.carte import Carte
from fonctions.receiveRobotMoves import *
from fonctions.move import *
...
isOnExit = False
while isOnExit == False: #Tant que le robot n'est pas sur la sortie...
#On demande au joueur la direction qu'il veut prendre
receiveRobotMoves()
#On fait avancer le robot
conteneur = move(Labyrinthe, movesInformation['direction'],
movesInformation['steps'])
#On met à jour le labyrinthe
Labyrinthe = conteneur
你能告诉我我能做些什么使它工作吗。你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐