这就是我所拥有的
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'