我的Python代码出错了

时间:2017-12-03 03:24:43

标签: python

现在我正在使用libraty Turtle在Python中进行简单的视频游戏,但是出现了这个错误,我不知道如何解决它。

我的代码在这里:

pastebin.com/wu5jM0gT

错误:

Traceback (most recent call last):
File "C:/Users/ricar/PycharmProjects/Juego/Juego.py", line 122, in <module>
objetivo.movimiento()
File "C:/Users/ricar/PycharmProjects/Juego/Juego.py", line 91, in movimiento
self.forward(self.speed)
File "C:\Python27\lib\lib-tk\turtle.py", line 1553, in forward
self._go(distance)
File "C:\Python27\lib\lib-tk\turtle.py", line 1520, in _go
ende = self._position + self._orient * distance
File "C:\Python27\lib\lib-tk\turtle.py", line 277, in __mul__
return Vec2D(self[0]*other, self[1]*other)
TypeError: unsupported operand type(s) for *: 'float' and 'instancemethod'`

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

你忘记了括号

self.forward(self.speed())