如何解决此错误“无法将序列乘以'float'类型的非整数?

时间:2020-06-12 15:57:46

标签: python pygame

这就是我所拥有的

import math
from pygame import*

playerpos = [100, 100]
player = image.load("images/ViktorTesla.bmp")
position = mouse.get_pos()
angle = (position[1]-(playerpos[1]+32), position[0]-(playerpos[0]+26))
playerrot = transform.rotate(player, 360-angle*57.29)
playerpos1 = (playerpos[0]-playerrot.get_rect().width/2, playerpos[1] playerrot.get_rect().height/2)    

该错误显示在第7行中,我不确定如何解决该错误。 这是回溯

File "/Users/jasleenb/Desktop/Comp Sci/Game/game.py", line 138, in <module>
  main_menu()
File "/Users/jasleenb/Desktop/Comp Sci/Game/game.py", line 40, in main_menu
  game()
File "/Users/jasleenb/Desktop/Comp Sci/Game/game.py", line 106, in game
  drawscene(screen, button, backgrounX)
File "/Users/jasleenb/Desktop/Comp Sci/Game/game.py", line 90, in drawscene
  playerrot = transform.rotate(player, 360-angle*57.29)

builtins.TypeError: can't multiply sequence by non-int of type 'float'

0 个答案:

没有答案