Python 即使表面看起来正确,也无法创建表面 self.image=pygame.Surface( int(数学sqrt((结束位置[1]-开始位置[1])**2+(结束位置[0]-开始位置[0])**2)),宽度)

Python 即使表面看起来正确,也无法创建表面 self.image=pygame.Surface( int(数学sqrt((结束位置[1]-开始位置[1])**2+(结束位置[0]-开始位置[0])**2)),宽度),python,pygame,pygame-surface,Python,Pygame,Pygame Surface,返回错误: 的构造函数的参数是一个具有曲面大小的元组(pygame.Surface((with,height))): self.image=pygame.Surface(int(math.sqrt((end_pos[1]-start_pos[1])**2+(end_pos[0]-start_pos[0])**2)),宽度) self.image=pygame.Surface( (int(数学sqrt((结束位置[1]-开始位置[1])**2+(结束位置[0]-开始位置[0])**2)),宽度)

返回错误:


的构造函数的参数是一个具有曲面大小的元组(
pygame.Surface((with,height))
):

self.image=pygame.Surface(int(math.sqrt((end_pos[1]-start_pos[1])**2+(end_pos[0]-start_pos[0])**2)),宽度)

self.image=pygame.Surface(
(int(数学sqrt((结束位置[1]-开始位置[1])**2+(结束位置[0]-开始位置[0])**2)),宽度)
分别

value=int(数学sqrt((结束位置[1]-开始位置[1])**2+(结束位置[0]-开始位置[0])**2))
self.image=pygame.Surface((值、宽度))

非常感谢你,我怎么会这么高兴呢stupid@aadnnn1不客气。请阅读并考虑你发现最有用的东西。
ValueError: size needs to be (int width, int height)