我不断收到关于参数数量错误的错误

时间:2018-07-29 01:58:12

标签: python-3.x class arguments parameter-passing superclass

我是一名学生,所以我想弄清楚自己做错了什么。谁能发现我可能会做的事?

super(Fighter, self).__init__(modelPath, parentNode, nodeName, 0, 0, 0, 3.0, )

TypeError: __init__() takes at most 3 arguments (8 given)**

代码:

 class Fighter(ShowBase, object):
    fighterCount = 0
    def __init__(self, modelPath, parentNode, nodeName, posVec, traverser, scaleVec = 1.0):
        super(Fighter, self).__init__(modelPath, parentNode, nodeName, 0, 0, 0, 3.0, )

        self.modelNode.setScale(scaleVec)
        self.modelNode.setPos(posVec)

        self.trav = traverser

        self.origin = render.attachNewNode("origin")
        self.origin.setPos(0, 0, 0)
        self.origin.hide()

        self.setKeyBindings()

        self.hud = Hud("./Tools/Hud.x", self.modelNode, "Hud", (0, 10, 0))

0 个答案:

没有答案