我下面包含的代码引发以下错误:
NameError: name 'Vector2' is not defined
在这一行:
def Translate (self, pos: Vector2):
为什么Python无法Vector2在Translate方法中识别我的类?
class Vector2:
def __init__(self, x: float, y: float):
self.x = x
self.y = y
def Translate(self, pos: Vector2):
self.x += pos.x
self.y += pos.y
跃然一笑
30秒到达战场
相关分类