我一直在用pygame创建一个小的基于tile的引擎,最近当我添加摄像头python突然不像一个我没有调过的类(据我记忆)除了在最后的方法最后一行,但现在我得到的问题使用类:使用python类的错误
http://i1344.photobucket.com/albums/p642/tobbeman/spelmotorFel1_zps689775f2.jpg http://i1344.photobucket.com/albums/p642/tobbeman/spelmotorFel2_zps5deb0c0d.jpg
任何有识之士将不胜感激! -Tobbe
*编辑
from player import *
from levelclass import *
这是我怎么被导入
self.player = Player()
self.level = Level()
这是我想要使用的类
self.level = Level()
NameError: global name 'Level' is not defined
而且这是我得到的错误,我的问题是,为什么? 的类看起来非常除了levelclass我在这家藏汉导入其他类一样,类看起来是这样的:
from tileclass import *
from cameraclass import *
class Level:
def __init__(self):
和
class Player:
def __init__(self):
任何人都知道为什么它不会进口?
请将截图改为代码片段,可以方便地复制和阅读 – lejlot
它不是一个问题。 –
除非您将浏览器放大到很远,否则几乎不可能读取屏幕截图中的代码。请发布代码。 – iCodez